diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2026-09-18 17:33:48 +0100 |
|---|---|---|
| committer | Lewis Russell <me@lewisr.dev> | 2026-10-15 18:22:38 +0100 |
| commit | 380cccb11f1ffcd9ecf15a1b2ac8e2502df0eed1 (patch) | |
| tree | c6df4ea5f85eefa01eea25d8365a03b83b6b66b2 /runtime/lua/vim/_ftplugin/lua.lua | |
| parent | 8f5f17f415ea382a97f4cc04f89873cadf5c244b (diff) | |
| download | rneovim-380cccb11f1ffcd9ecf15a1b2ac8e2502df0eed1.tar.gz rneovim-380cccb11f1ffcd9ecf15a1b2ac8e2502df0eed1.tar.bz2 rneovim-380cccb11f1ffcd9ecf15a1b2ac8e2502df0eed1.zip | |
fix(options): extend dry-run validation
Problem: nvim_set_option_value() dry runs skip checks in did_set_*
callbacks. This logic also prepares values needed to apply the option,
such as tab widths or a compiled regexp. Moving the checks into
validation callbacks needs a way to save that work for did_set_*.
Solution: Store prepared values in optset_T so did_set_* can consume
them after the option is stored. Dry runs perform the same validation,
then free the prepared values without changing live state.
This extends dry-run validation for:
- 'cedit': reject invalid command-line window keys.
- 'completeitemalign': require each completion column exactly once.
- 'cursorlineopt': reject empty values and conflicting line modes.
- 'encoding': accept only UTF-8 and its aliases.
- 'fileencoding': reject lists and local changes with 'nomodifiable'.
- 'messagesopt': require mandatory fields and enforce numeric limits.
- 'spellcapcheck': return regexp errors, including under :silent!.
- 'spellsuggest': reject conflicting suggestion modes.
- 'varsofttabstop' and 'vartabstop': reject invalid tab widths.
- 'wildmode': reject more than four completion stages.
'makeencoding' also uses the shared encoding preparation.
Separating value preparation exposed a bug in 'vartabstop' and
'varsofttabstop': failed assignments could discard local tab widths, and
global assignments could overwrite them. Fix this by preparing new
widths separately and applying them only after a valid local assignment.
AI-assisted
Diffstat (limited to 'runtime/lua/vim/_ftplugin/lua.lua')
0 files changed, 0 insertions, 0 deletions