mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
core: add a way to count the suffix length in max chars displayed in cut of string ("cut:" and "cutscr:") (closes #963)
The format to use is one of:
- ${cut:+max,suffix,string}
- ${cutscr:+max,suffix,string}
With the "+" before max, WeeChat ensures there are at most "max" chars in
output, including the length of suffix string.
This commit is contained in:
@@ -7269,9 +7269,11 @@ command_init ()
|
||||
" 1. an evaluated sub-string (format: \"eval:xxx\")\n"
|
||||
" 2. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n"
|
||||
" 3. a string with chars to hide (format: \"hide:char,string\")\n"
|
||||
" 4. a string with max chars (format: \"cut:max,suffix,string\")\n"
|
||||
" 4. a string with max chars (format: \"cut:max,suffix,string\" "
|
||||
"or \"cut:+max,suffix,string\")\n"
|
||||
" or max chars displayed on screen "
|
||||
"(format: \"cutscr:max,suffix,string\")\n"
|
||||
"(format: \"cutscr:max,suffix,string\" or "
|
||||
"\"cutscr:+max,suffix,string\")\n"
|
||||
" 5. a color (format: \"color:xxx\", see \"Plugin API "
|
||||
"reference\", function \"color\")\n"
|
||||
" 6. an info (format: \"info:name,arguments\", arguments are "
|
||||
@@ -7311,7 +7313,8 @@ command_init ()
|
||||
" /eval -n ${window.buffer.number} ==> 1\n"
|
||||
" /eval -n ${\\t} ==> <tab>\n"
|
||||
" /eval -n ${hide:-,${relay.network.password}} ==> --------\n"
|
||||
" /eval -n ${cut:2,+,test} ==> te+\n"
|
||||
" /eval -n ${cut:3,+,test} ==> tes+\n"
|
||||
" /eval -n ${cut:+3,+,test} ==> te+\n"
|
||||
" /eval -n ${date:%H:%M:%S} ==> 07:46:40\n"
|
||||
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
|
||||
"\n"
|
||||
|
||||
Reference in New Issue
Block a user