aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_ftplugin/lua.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2026-10-01 12:40:25 +0200
committerJustin M. Keyes <justinkz@gmail.com>2026-10-04 17:46:58 +0200
commit025b12a4dc7dc656c9e33404531d09c5297ecc21 (patch)
tree822f1341fde051596eb6a10ec05c2c03175db01a /runtime/lua/vim/_ftplugin/lua.lua
parent39a740aaa70bc0021e7a329818089bfa3f8c7a57 (diff)
downloadrneovim-025b12a4dc7dc656c9e33404531d09c5297ecc21.tar.gz
rneovim-025b12a4dc7dc656c9e33404531d09c5297ecc21.tar.bz2
rneovim-025b12a4dc7dc656c9e33404531d09c5297ecc21.zip
fix(env): multibyte $VAR name may end mid-char
Problem: 'isident' is checked per byte (inherited from Vim), so a name can end in the middle of a multibyte char: with "192-255", `$é` (C3 A9) looks up "\xC3". - Unix: expands an env var named "\xC3", plus a stray "\xA9". - Windows: uv_os_getenv() rejects the name (invalid UTF-8), and os_getenv() logs an error. `$VAR` in expressions (get_env_len()) and cmdline completion have the same scan. Solution: `vim_isIDp()`: a multibyte char is an identifier char only if it is valid UTF-8 and 'isident' has all its bytes. Use it in expand_env_esc(), get_env_len() and cmdline completion. Names whose bytes are all in 'isident' still work, e.g. `$aあ` with the Windows default. Assert UV_EINVAL in os_getenv() and os_getenv_buf() (like os_env_exists() and os_setenv() already do): Nvim no longer passes invalid UTF-8.
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions