241 Commits

Author SHA1 Message Date
Sébastien Helleu
12a6f74ec0 core: fix check of tags in lines
All changes:
- fix check of tags in lines: check lines without tags, fix check of tags with
  negation ("!tag")
- add string functions string_split_tags and string_free_split_tags
- add tests on function gui_line_match_tags
2018-08-12 20:30:13 +02:00
Sébastien Helleu
1abf4040f1 core: add reverse of string in evaluation of expressions with "rev:" (closes #1200) 2018-06-02 16:01:14 +02:00
Sébastien Helleu
ab9a0ec2e6 tests: add missing tests on function string_cut 2018-06-02 15:19:16 +02:00
Sébastien Helleu
ba19fa9963 core: count number of chars instead of bytes for suffix in function string_cut 2018-06-02 15:18:29 +02:00
Sébastien Helleu
49253bd4d9 tests: fix test of function utf8_strlen_screen on Han char (U+24B62) 2018-06-02 14:42:29 +02:00
Sébastien Helleu
afb1d03053 Merge remote-tracking branch 'origin/pr/623' into irc-3.2-cap 2018-05-20 15:21:07 +02:00
Sébastien Helleu
ba13d764e6 tests: add tests on eval_expression() with different prefix/suffix 2018-04-17 20:26:45 +02:00
Sébastien Helleu
cc06b95ba7 tests: add tests on infolists 2018-04-12 19:47:42 +02:00
Sébastien Helleu
be7002b70d tests: fix tests on function string_regex_flags 2018-01-07 15:04:24 +01:00
Sébastien Helleu
ed4837b2f6 core: update copyright dates 2018-01-05 00:54:18 +01:00
Sébastien Helleu
1d56e17b2f core: allow floating point and hexadecimal numbers in comparison of evaluated values 2017-10-17 20:43:40 +02:00
Sébastien Helleu
8a32249507 javascript: fix detection of libv8 with autotools on Ubuntu Trusty 2017-10-07 21:43:18 +02:00
Sébastien Helleu
e317a6856c tests: add PHP plugin in tests 2017-09-03 21:49:48 +02:00
Sébastien Helleu
c65137667b tests: improve tests on dynamic strings 2017-08-20 11:26:23 +02:00
Sébastien Helleu
b879df09b5 tests: check that fset plugin is loaded 2017-06-25 16:35:28 +02:00
Simmo Saan
0a4be02dc3 core: add hashtable_add_from_infolist to API 2017-06-17 20:03:40 +03:00
Simmo Saan
1329dfb57a core: add wildcard matching operators to eval (closes #608) 2017-04-29 17:04:44 +02:00
Sébastien Helleu
5b78cb2a7b tests: fix compilation warning on FreeBSD 2017-04-26 22:28:03 +02:00
Sébastien Helleu
112bebcddf 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.
2017-04-24 22:37:49 +02:00
Sébastien Helleu
94355e2e38 core: ensure length is not negative in function string_strndup 2017-04-22 15:15:54 +02:00
Sébastien Helleu
6ab7af705e tests: fix tests on dynamic strings 2017-04-01 12:16:12 +02:00
Sébastien Helleu
bb00b6b8fb core: add ${re:#} to get the index of last group captured in evaluation of expressions 2017-03-30 22:13:14 +02:00
Sébastien Helleu
467f482ea6 core: make "callback_cmp" optional in call to function arraylist_new()
If no callback is given, a default callback is used, which just compares
pointers.
2017-03-30 20:35:16 +02:00
Sébastien Helleu
eb2d0ac58a tests: add tests on combining characters in cut/cutscr (evaluation of expression) 2017-03-28 22:09:11 +02:00
Sébastien Helleu
3045021430 core: fix cut of chars in "cutscr" of evaluated strings
This fixes two problems:
- stop before max char displayed with wide chars
- preserve combining chars in the output

Before the fix (wrong):

>> ${cutscr:3,+,こんにちは世界}
== [こん+]
>> ${cutscr:1,+,a${\u0308}}
== [a+]

After the fix (OK):

>> ${cutscr:3,+,こんにちは世界}
== [こ+]
>> ${cutscr:1,+,a${\u0308}}
== [ä]
2017-03-28 20:45:31 +02:00
Sébastien Helleu
f99c866f35 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.
2017-03-27 21:14:51 +02:00
Sébastien Helleu
9a8ec36cbd core: add cut of string in evaluation of expressions
The syntax is: ${cut:max,suffix,string}.
The string is cut after max chars. If the string is cut, the optional suffix is
added after.
2017-03-25 14:19:48 +01:00
Sébastien Helleu
edfeb60e32 buflist: new plugin "buflist" (bar with list of buffers) 2017-03-25 14:18:19 +01:00
Sébastien Helleu
83117f8d2a core: add ternary operator (condition) in evaluation of expressions 2017-03-25 14:18:19 +01:00
Sébastien Helleu
07d16903f3 api: add dynamic string functions (string_dyn_*)
New functions:
- string_dyn_alloc
- string_dyn_copy
- string_dyn_concat
- string_dyn_free
2017-03-25 14:18:19 +01:00
Sébastien Helleu
705d86e684 core: update copyright dates 2017-01-01 11:32:04 +01:00
Sébastien Helleu
54841f6294 api: fix return of function string_match() when there are multiple masks in the string (issue #812)
Some tests are added as well to test the multiple masks in the string.
2016-10-02 08:58:19 +02:00
Sébastien Helleu
e218db3582 tests: add test on the "extra" option on function eval_expression() 2016-08-18 22:11:50 +02:00
Sébastien Helleu
eb86def400 core: rename function string_iconv_fprintf to string_fprintf 2016-07-09 18:28:03 +02:00
Sébastien Helleu
22c0966387 tests: add tests on function string_split_command() 2016-05-14 09:14:08 +02:00
Wojciech Kwolek
a44bcaf080 core: fix the hardcoded separator in string_split_command 2016-05-08 12:14:17 +02:00
Sébastien Helleu
50817054f9 tests: add tests on string_split() with keep_eol set to 2 2016-01-23 10:35:07 +01:00
Sébastien Helleu
3330724574 core: update copyright dates 2016-01-01 11:09:53 +01:00
Sébastien Helleu
57b6e320d3 core: fix execution of empty command name
The strings "/" and "/ " are not considered as valid commands any more.
2015-12-31 19:07:14 +01:00
Sébastien Helleu
a60075fb39 tests: temporary disable check of javascript plugin
The compilation with autotools fails to detect v8 lib (used by
javascript plugin) on Ubuntu Trusty, so the tests are failing because
javascript plugins is not loaded.

This check will be enabled again when autotools compilation will be
fixed.
2015-12-25 12:02:34 +01:00
Sébastien Helleu
6ff8de5740 tests: check if all plugins are loaded 2015-12-24 22:21:33 +01:00
Sébastien Helleu
41cb1bf635 api: fix handle of invalid escape in function string_convert_escaped_chars()
And a new test is now checking that "\" returns "".
2015-08-24 11:05:31 +02:00
Sébastien Helleu
951d1f91a4 api: add function string_hex_dump() 2015-08-22 09:30:08 +02:00
Sébastien Helleu
46a9d17ac3 api: add argument "length" in function utf8_is_valid() 2015-08-18 07:36:48 +02:00
Sébastien Helleu
4ecd8a505f api: fix type of value returned by functions utf8_prev_char, utf8_next_char and utf8_add_offset 2015-07-04 08:39:55 +02:00
Sébastien Helleu
9bf40517d3 api: add support of evaluated sub-strings and current date/time in function string_eval_expression() and command /eval 2015-06-30 20:25:35 +02:00
Sébastien Helleu
2bd2d74a07 api: add function string_eval_path_home() 2015-06-24 07:54:42 +02:00
Sébastien Helleu
d322389e04 core: add support of full color option name in command /eval and API function string_eval_expression() 2015-04-26 10:29:30 +02:00
Sébastien Helleu
b2a68af077 core: add options weechat.look.word_chars_{highlight|input} (closes #55, task #9459) 2015-04-11 18:53:44 +02:00
Sébastien Helleu
8b056d7d24 tests: check that function string_strndup returns NULL if the given string is NULL 2015-03-22 11:14:12 +01:00