Fixes#35884
Problem: Since `once_buf_loaded` might call a callback passed to it at a
later point (which is it's reason to exist) that callback might end up
referring to stale diagnostics in a handler's `show` function. For
example, if we first call `vim.diagnostic.set` for an unloaded buffer,
then call `vim.diagnostic.reset` and only then load the buffer, we might
still see diagnostics from `vim.diagnostic.set` call, which are stale at
this point.
Solution: only keep one autocommand from the most reset `show` call and
delete it when `hide` is called.
The current description (especially the "unlimited width" part) is
inaccurate in several ways:
- The size of virtual text can depend on window width. In particular,
the size of "above" virtual text can be equal to window width.
- A double-width character that doesn't fit adds 1 to the virtual column
of the following characters.
- The size of 'showbreak' and 'breakindent' is counted.
related: vim/vim#5713closes: vim/vim#18447014c731fa5
Problem:
Autocmds in inline_completion Completor are not scoped to specific
buffers. When multiple buffers have inline completion enabled, events
(InsertEnter, CursorMovedI, TextChangedP, InsertLeave) in any buffer
trigger callbacks for all Completor instances, causing incorrect
behavior across buffers.
Solution:
Add `buffer = bufnr` parameter to nvim_create_autocmd() calls to make
them buffer-local. Each Completor instance now only responds to events
in its own buffer.
Change the second "if" to "because", otherwise it may be misinterpreted
that preinserted() can return non-zero just because these options are
set.
closes: vim/vim#184094edaf89233
Problem: completion: autocompletion can be improved
Solution: Add support for "longest" and "preinsert" in 'autocomplete';
add preinserted() (Girish Palya)
* Add support for "longest" in 'completeopt' when 'autocomplete'
is enabled. (Note: the cursor position does not change automatically
when 'autocomplete' is enabled.)
* Add support for "preinsert" when 'autocomplete' is enabled. Ensure
"preinsert" works the same with and without 'autocomplete'
* introduce the preinserted() Vim script function, useful for defining
custom key mappings.
fixes: vim/vim#18314closes: vim/vim#18387c05335082a
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: tex syntax file does not support some of the math equation
environments provided by amsmath.sty, therefore well-formed
snippet is highlighted as "texBadMath"
Solution: add the environments
closes: vim/vim#1843305e44e978f
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
- Match comments after Vim9 :echo and :execute.
- Match comments after Vim9 and legacy :eval.
closes: vim/vim#18420f4a6acd86e
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Include post operator whitespace in the Vim9 variable assignment
lookahead so that "redir =>" doesn't match as an assignment.
fixes: vim/vim#18319closes: vim/vim#1832357d243e27d
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: 'nowrap' in a modeline may hide malicious code.
Solution: Forcibly use '>' as 'listchars' "extends" if 'nowrap' was set
from a modeline (zeertzjq).
Manual `:setlocal nowrap` disables this behavior. There is a separate
problem with `:set nowrap` that also applies to some other options.
related: vim/vim#18214
related: vim/vim#18399closes: vim/vim#184259d5208a931
Cherry-pick some test_modeline.vim changes from patches 9.0.{0363,0626}.
Problem: :update should write new file buffers, but previous fix
affected special buffer types (acwrite, nofile, etc.).
Solution: Add bt_nofilename() check to only write new files for
buffers representing real filesystem paths.
fix(extui): set options and buffer name after 'eventignorewin'
Problem: Setting up extui buffers emits OptionSet and BufFilePost events.
Solution: Set options and buffer name after 'eventignorewin'.
Explicitly mention the "..=" compound assignment operator everywhere
".=" is documented.
Convert some uses of "." and ".=" in the examples to ".." and "..=",
respectively.
closes: vim/vim#18380b6f9d38f96
Cherry-pick a change to eval.txt from patch 9.1.1232.
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Match the full :wincmd command syntax.
Allow for oneline assignment to Vim9 variables named winc[md].
Fixesvim/vim#18368.
b1446dfd23
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: filetype: not all Sway config files are recognized
Solution: Detect files within */sway/config.d/* as swayconfig filetype
(Felix Pehla).
Sways default config automatically includes files placed in
@sysconfdir@/sway/config.d/* (see config.in), so it makes sense to use
the sway syntax for those.
related: vim/vim#1829324f0dbba8c
Co-authored-by: Felix Pehla <29adc1fd92@gmail.com>
- unified bashStatement, kshStatement and shStatement as much as
possible
- separated builtin commands from external programs
- cleaned up kornshell flavor logic
- fixed alias syntax highlighting
- added test for bash alias syntax highlighting
- removed daemon keyword
closes: vim/vim#1835511bde1f169
Co-authored-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
Problem: example code refers to `vim.lsp.buf.document_color`, but there
is no such thing.
Solution: replace `vim.lsp.buf.document_color` with `vim.lsp.document_color`.
Problem:
Diagnostics set on unloaded buffers are not shown when the buffer loads.
Solution:
Use `once_buf_loaded()` to show the diagnostics on BufRead is the buffer
is not yet loaded.
Problem:
pyenv-virtualenv sets a different path for VIRTUAL_ENV than the path to the
python binary it provides, but these paths both symlink to the same file, so
there should be no disparity. The python health-check reports an error, since it
only checks if these paths are equal, not where they point to (resolve to).
Solution:
- Resolve the python symlinks before checking if they are equal.
- Deduplicate some code.
Problem: completion: 'autocomplete' cannot be enabled per buffer
(Tomasz N)
Solution: Make 'autocomplete' global or local to buffer (Girish Palya)
fixes: vim/vim#18320closes: vim/vim#183330208b3e80a
Co-authored-by: Girish Palya <girishji@gmail.com>
Problem: cannot calculate sha256() of a Blob
Solution: Change sha256() to accept a Blob or String argument
(thinca).
closes: vim/vim#183364150283b83
Co-authored-by: thinca <thinca@gmail.com>