diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-03-10 09:13:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-10 09:13:30 +0800 |
| commit | 29fa072b34ac24a71a35a000236485702f20f97f (patch) | |
| tree | 23b813eb115bf23f807306900030ce697fc5a5b8 /runtime/syntax/python.vim | |
| parent | a81b059a45ba832f9ad0bdb1b37b7519e5922cac (diff) | |
| download | rneovim-29fa072b34ac24a71a35a000236485702f20f97f.tar.gz rneovim-29fa072b34ac24a71a35a000236485702f20f97f.tar.bz2 rneovim-29fa072b34ac24a71a35a000236485702f20f97f.zip | |
vim-patch:partial:9.2.0126: String handling can be improved (#38214)
Problem: String handling can be improved
Solution: Pass string length where it is known to avoid strlen() calls,
do a few minor refactors (John Marriott).
This commit changes some calls to function `set_vim_var_string()` to pass
the string length where it is known or can be easily calculated.
In addition:
In `evalvars.c`:
* In function `set_reg_var()` turn variable `regname` into a C string
because that is how it used.
* Small cosmetics.
In `option.c`:
* Slightly refactor function `apply_optionset_autocmd()` to move some
variables closer to where they are used.
In `getchar.c`:
* Slightly refactor function `do_key_input_pre()`:
-> change call to `dict_add_string()` to `dict_add_string_len()` and
pass it the length of `buf`.
-> only call `get_vim_var_string()` once.
In `message.c`:
* Use a `string_T` to store local variable `p`.
In `normal.c`:
* Move some variables closer to where they are used.
closes: vim/vim#19618
https://github.com/vim/vim/commit/727f6e2686fb1d06b9591e6de689763a479cc664
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions