summaryrefslogtreecommitdiff
path: root/doc/pl
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-04-24 22:37:49 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-04-24 22:37:49 +0200
commit112bebcddf99d5187ede8ebbe765abc75373c4f2 (patch)
tree3430bc6a930518eb0fe325c93bd7217d823083c6 /doc/pl
parent0470a71af9e9da57b39702f94705f5f43cec5448 (diff)
downloadweechat-112bebcddf99d5187ede8ebbe765abc75373c4f2.zip
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.
Diffstat (limited to 'doc/pl')
-rw-r--r--doc/pl/autogen/user/weechat_commands.adoc7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/pl/autogen/user/weechat_commands.adoc b/doc/pl/autogen/user/weechat_commands.adoc
index b85e42d6c..fa6395d45 100644
--- a/doc/pl/autogen/user/weechat_commands.adoc
+++ b/doc/pl/autogen/user/weechat_commands.adoc
@@ -285,8 +285,8 @@ Some variables are replaced in expression, using the format ${variable}, variabl
1. an evaluated sub-string (format: "eval:xxx")
2. a string with escaped chars (format: "esc:xxx" or "\xxx")
3. a string with chars to hide (format: "hide:char,string")
- 4. a string with max chars (format: "cut:max,suffix,string")
- or max chars displayed on screen (format: "cutscr:max,suffix,string")
+ 4. a string with max chars (format: "cut:max,suffix,string" or "cut:+max,suffix,string")
+ or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a color (format: "color:xxx", see "Plugin API reference", function "color")
6. an info (format: "info:name,arguments", arguments are optional)
7. current date/time (format: "date" or "date:format")
@@ -314,7 +314,8 @@ Examples (simple strings):
/eval -n ${window.buffer.number} ==> 1
/eval -n ${\t} ==> <tab>
/eval -n ${hide:-,${relay.network.password}} ==> --------
- /eval -n ${cut:2,+,test} ==> te+
+ /eval -n ${cut:3,+,test} ==> tes+
+ /eval -n ${cut:+3,+,test} ==> te+
/eval -n ${date:%H:%M:%S} ==> 07:46:40
/eval -n ${if:${info:term_width}>80?big:small} ==> big