Sébastien Helleu
fdcab27513
core: fix integer overflow in function util_version_number
2025-05-11 15:59:36 +02:00
Sébastien Helleu
c6df2e7b8e
tests: fix long lines in scripting API tests
2023-01-04 21:13:25 +01:00
Sébastien Helleu
e6857871f0
tests: ignore module level import not at top of file (flake8 E402)
2023-01-04 21:12:53 +01:00
Sébastien Helleu
d1f2d54a1e
tests: mark methods is_bool and is_number as static
2023-01-04 21:11:41 +01:00
Sébastien Helleu
33bba784c3
core: update copyright dates
2023-01-01 14:54:35 +01:00
Sébastien Helleu
1fb6d52984
tests: add tests on gui input functions
2023-01-01 14:41:06 +01:00
Sébastien Helleu
73bac5491b
core: move function gui_input_move_to_buffer to gui-buffer.c
2022-12-31 10:40:00 +01:00
Sébastien Helleu
05839983d4
core: fix color when the delimiter is not followed by a background color ( closes #1867 )
2022-12-30 21:50:18 +01:00
Sébastien Helleu
41fd26fe79
core: move /input buffer switch/zoom actions to command /buffer
...
Actions moved:
* `/input switch_active_buffer` -> `/buffer switch`
* `/input switch_active_buffer_previous` -> `/buffer switch -previous`
* `/input zoom_merged_buffer` -> `/buffer zoom`
2022-12-25 22:47:18 +01:00
Sébastien Helleu
0c29d4c5b6
core: move /input set_unread actions to commands /allbuf and /buffer set
...
Actions moved:
* `/input set_unread` -> `/allbuf /buffer set unread`
* `/input set_unread_current_buffer` -> `/buffer set unread`
2022-12-25 21:44:27 +01:00
Sébastien Helleu
babe1e7a42
core: move /input hotlist actions to new command /hotlist
...
Actions moved to command `/hotlist`:
* `/input hotlist_clear` -> `/hotlist clear`
* `/input hotlist_remove_buffer` -> `/hotlist remove`
* `/input hotlist_restore_buffer` -> `/hotlist restore`
* `/input hotlist_restore_all` -> `/hotlist restore -all`
2022-12-25 18:50:57 +01:00
Sébastien Helleu
574a4c8834
core: add function gui_buffer_jump_last_visible_number
2022-12-25 17:57:59 +01:00
Sébastien Helleu
c9796a3141
core: move /input jump actions to command /buffer jump
...
Actions moved to command `/buffer jump`:
* `/input jump_smart` -> `/buffer jump smart`
* `/input jump_previously_visited_buffer` -> `/buffer jump prev_visited`
* `/input jump_next_visited_buffer` -> `/buffer jump next_visited`
* `/input jump_last_buffer_displayed` -> `/buffer jump last_displayed`
2022-12-25 17:00:37 +01:00
Sébastien Helleu
21f3575016
api: add functions string_strcmp and string_strncmp
2022-12-24 18:29:35 +01:00
Sébastien Helleu
a67556907d
api: rename char comparison functions "utf8_char*" to "string_char*"
2022-12-24 17:33:22 +01:00
Sébastien Helleu
083032972d
api: return arithmetic difference between chars in string comparison functions
...
Return code is changed for the following functions:
- string_strcasecmp
- string_strcasecmp_range
- string_strncasecmp
- string_strncasecmp_range
- string_strcmp_ignore_chars
- utf8_charcmp
- utf8_charcasecmp
- utf8_charcasecmp_range
2022-12-24 16:25:20 +01:00
Sébastien Helleu
5fc656a1b8
api: fix function strcmp_ignore_chars with case sensitive comparison and wide chars starting with the same byte
2022-12-23 23:20:29 +01:00
Sébastien Helleu
68b510517e
core: improve case convert and insensitive char comparisons ( closes #258 )
...
All lowercase letters are now properly converted to uppercase letters (and vice
versa), via functions `towupper` and `towlower`.
Functions `string_tolower`, `string_toupper` and `utf8_charcasecmp` have been
optimized to be faster when there are ASCII chars (< 128); functions are about
25-40% faster with mixed chars (both ASCII and multi-bytes).
Function `utf8_wide_char` has been removed, `utf8_char_int` can be used
instead.
2022-12-21 20:49:09 +01:00
Sébastien Helleu
40339b288a
api: return newly allocated string in functions string_tolower and string_toupper
2022-12-18 14:28:58 +01:00
Sébastien Helleu
eb6cc0bc2a
core: return number of bytes for UTF-8 char in function utf8_int_string
2022-12-18 14:13:14 +01:00
Sébastien Helleu
6aedddd351
tests: add tests on function gui_input_delete_next_word
2022-12-18 14:13:14 +01:00
Sébastien Helleu
9b917ccace
tests: add tests on function gui_input_delete_range
2022-12-18 14:13:14 +01:00
Sébastien Helleu
99c453ee23
tests: add tests on gui delete previous/next char functions
2022-12-18 14:13:14 +01:00
Sébastien Helleu
d2f447dafc
tests: add extra tests on function gui_input_set_pos
2022-12-18 14:13:14 +01:00
Sébastien Helleu
3ef8241444
tests: add tests on gui input completion functions
2022-12-18 14:13:14 +01:00
Sébastien Helleu
dd9ae79204
core: remove unused argument "pos" from function gui_input_insert_string, add tests on function
2022-12-18 14:13:14 +01:00
Sébastien Helleu
18c9ade580
core: add whole string information in /debug unicode
2022-12-10 17:32:09 +01:00
Sébastien Helleu
5b9b1e175b
core: add color attributes "blink" and "dim" (half bright) ( closes #1855 )
2022-12-10 16:37:03 +01:00
Sébastien Helleu
ef842c5e62
core: fix function string_cut when there are non printable chars in suffix
2022-12-10 16:05:14 +01:00
Sébastien Helleu
f1cfd6f73f
core: do not display non printable chars, fix function utf8_char_size_screen
...
Now the function utf8_char_size_screen can return -1 when the char is not
printable.
It has a specific behavior for some chars:
- U+0009: value of option weechat.look.tab_width
- U+0001 to U+001F (except U+0009): 1
- U+00AD (soft hyphen): -1
- U+200B (zero width space): -1
2022-12-10 16:05:14 +01:00
Sébastien Helleu
71ae8f1907
api: add function utf8_strncpy
2022-12-10 16:05:14 +01:00
Sébastien Helleu
e5cbbd781d
core: optimize and fix function utf8_strlen_screen with non printable chars
...
When there non printable chars, the return of the function was 1.
For example utf8_strlen_screen("abc\x01") now returns 4 instead of 1.
In addition the function has been optimized to not use the `mbstowcs` function
which is slow; result is up to 15% faster.
2022-12-10 16:05:14 +01:00
Sébastien Helleu
0e6677fbcb
core: add result of utf8_char_size_screen in /debug unicode
2022-12-10 16:05:14 +01:00
Sébastien Helleu
55569c182a
core: display hex codepoint before integer codepoint in /debug unicode
2022-12-03 10:15:18 +01:00
Sébastien Helleu
bbd0f5d26b
tests: define constants with UTF-8 strings, add tests on functions returning size on screen
2022-11-27 12:29:36 +01:00
Sébastien Helleu
baab9cc7c5
core: add option unicode in command /debug
2022-11-21 20:45:41 +01:00
Sébastien Helleu
bab73cfaa5
core: add identifier in buffer lines ( closes #901 )
...
For buffers with formatted content, the "id" starts to 0 on each buffer and is
incremented on each new line displayed (it is reset to 0 if reaching INT_MAX).
For buffers with free content, the "id" is set to the same value as "y" (ie the
line number, starting to 0).
2022-11-11 09:42:20 +01:00
Sébastien Helleu
24665ae878
core: add signals "buffer_user_{input|closing}_xxx" for buffers created with /buffer add ( closes #1848 )
2022-11-08 20:34:04 +01:00
Sébastien Helleu
7555993bbc
trigger: add regex command "y" to translate chars, set default regex command to "s" (regex replace) ( closes #1510 )
2022-11-06 09:14:14 +01:00
Sébastien Helleu
3b674a5e16
tests: add another test on function string_translate_chars
2022-11-05 22:34:39 +01:00
Sébastien Helleu
196a051141
core: add range of chars in evaluation of expressions with chars:xxx
2022-11-05 22:34:38 +01:00
Sébastien Helleu
bc2fb071e2
api: add function string_translate_chars
2022-11-05 22:34:38 +01:00
Sébastien Helleu
319abf4fd0
python: remove support of Python 2.x
2022-10-15 22:56:06 +02:00
Sébastien Helleu
7a544d5fcf
tests: ignore pylint error unnecessary-pass
2022-10-15 22:01:33 +02:00
Sébastien Helleu
56dbd871ea
api: do not expect any return value in callbacks change/delete of config_new_option (scripting API)
2022-10-15 21:46:00 +02:00
Sébastien Helleu
a1057c9a03
tests: add tests on config functions (scripting API)
2022-10-15 21:31:45 +02:00
Trygve Aaberge
fdb1ff3781
tests: Use LONGS_EQUAL for version number tests
...
util_version_number returns an int, but BYTES_EQUAL only compares the
last byte of the int, so it wouldn't test the rest of the int.
I see other tests for functions returning an int use LONGS_EQUAL, so
that seems correct to use.
2022-10-08 18:13:00 +02:00
Sébastien Helleu
26e6fdc645
api: add function file_compress
2022-09-27 20:49:12 +02:00
Sébastien Helleu
e7b6e8c60f
api: restrict number to integer in function string_parse_size
2022-09-27 15:50:43 +02:00
Sébastien Helleu
4d74a89cfc
api: add function string_parse_size
2022-09-27 15:50:43 +02:00