summaryrefslogtreecommitdiff
path: root/doc/it/autogen
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-09-21 07:56:21 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-09-21 07:56:21 +0200
commitdcfc4e8ed59e015d0d83944bdadf39e8b83298ea (patch)
tree124e81991dc639ef7a208c22653f89e29adb4eb6 /doc/it/autogen
parent1919f23c2d67dcf38765a06943e66f89d5873a62 (diff)
downloadweechat-dcfc4e8ed59e015d0d83944bdadf39e8b83298ea.zip
core: add "length:xxx" and "lengthscr:xxx" in evaluation of expressions
Diffstat (limited to 'doc/it/autogen')
-rw-r--r--doc/it/autogen/user/weechat_commands.adoc20
1 files changed, 11 insertions, 9 deletions
diff --git a/doc/it/autogen/user/weechat_commands.adoc b/doc/it/autogen/user/weechat_commands.adoc
index ee8b89271..e2b6961e8 100644
--- a/doc/it/autogen/user/weechat_commands.adoc
+++ b/doc/it/autogen/user/weechat_commands.adoc
@@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
- 7. a color (format: "color:xxx", see "Plugin API reference", function "color")
- 8. an info (format: "info:name,arguments", arguments are optional)
- 9. current date/time (format: "date" or "date:format")
- 10. an environment variable (format: "env:XXX")
- 11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
- 12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
- 13. an option (format: "file.section.option")
- 14. a local variable in buffer
- 15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
+ 7. length of a string (format: "length:xxx" or "lengthscr:xxx")
+ 8. a color (format: "color:xxx", see "Plugin API reference", function "color")
+ 9. an info (format: "info:name,arguments", arguments are optional)
+ 10. current date/time (format: "date" or "date:format")
+ 11. an environment variable (format: "env:XXX")
+ 12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
+ 13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
+ 14. an option (format: "file.section.option")
+ 15. a local variable in buffer
+ 16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
+ /eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):