1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

core: add cut of string with max chars displayed in evaluation of expressions

The syntax is: ${cutscr:max,suffix,string}.
The string is cut after max chars displayed on screen. If the string is cut,
the optional suffix is added after.
This commit is contained in:
Sébastien Helleu
2017-03-27 21:14:51 +02:00
parent f37ecbfefd
commit f99c866f35
31 changed files with 262 additions and 127 deletions
+2
View File
@@ -227,6 +227,8 @@ TEST(Eval, EvalExpression)
WEE_CHECK_EVAL("te+", "${cut:2,+,test}");
WEE_CHECK_EVAL("éà", "${cut:2,,éàô}");
WEE_CHECK_EVAL("éà+", "${cut:2,+,éàô}");
WEE_CHECK_EVAL("こん+", "${cut:2,+,こんにちは世界}");
WEE_CHECK_EVAL("こ+", "${cutscr:2,+,こんにちは世界}");
/* test color */
WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}");