**Problem(?):** Buffers that (for whatever reason) aren't meant to have
a final newline are still parsed with a final newline in `treesitter.c`.
**Solution:** Don't add the newline to the last buffer line if it
shouldn't be there. (This more closely matches the approach of
`read_buffer_into()`.)
This allows us to, say, use a scratch buffer with `noeol` and `nofixeol`
behind the scenes in `get_string_parser()`.
...which would allow us to track injection trees with extmarks in that
case.
...which would allow us to not drop previous trees after reparsing a
different range with `get_parser():parse()`.
...which would prevent flickering when editing a buffer that has 2+
windows to it in view at a time.
...which would allow us to keep our sanity!!!
(one step at a time...)
Problem: tests: "Untitled" file not removed when running Test_crash1_3 alone
with TEST_FILTER (after v9.1.0695)
Solution: Use a TearDown function instead of another test.
(zeertzjq)
closes: vim/vim#15578closes: vim/vim#15577d56c451e1c
Problem: tests: test_crash leaves Untitled file around
Solution: cleanup at the end of the test_crash.vim test file
cd83173def
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: buffer-overflow in do_search() with 'rightleft'
(SuyueGuo)
Solution: after reversing the text (which allocates a new buffer),
re-calculate the text length
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-v2x2-cjcg-f9jmcacb6693c1
Add missing change from patch 8.1.1270.
Omit `call delete('Untitled')`: moved again in patch 9.1.0695.
Co-authored-by: Christian Brabandt <cb@256bit.org>
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.
Problem: Marks are lost after `:bdelete` because `ignore_buf()` filters
out unlisted buffers during shada mark processing.
Solution: Revert to original buffer checks for mark operations, avoiding
`!buf->b_p_bl` condition that incorrectly ignores deleted buffers.
Problem: completion: "longest" doesn't work for manual completion when
'autocomplete' is on (after 9.1.1800).
Solution: Only reset compl_get_longest when enabling autocompletion
(zeertzjq).
closes: vim/vim#18430b3966d6a8e
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>
Problem: Option insecure flags not copied when splitting window.
Solution: Move window-local insecure flags to winopt_T and copy them
properly (zeertzjq).
closes: vim/vim#18434b3740f4b00
Problem: :set doesn't clear local insecure flag like :setlocal does.
Solution: Also clear the local insecure flag when using :set (zeertzjq).
This applies to local options like 'wrap', 'foldtext' and 'foldexpr',
whose global flags are actually never used. For global-local options
like 'statusline' the behavior is already correct, so add some tests.
related: vim/vim#18434fec5586a45
- 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.
`runtime/indent/Makefile` was removed in 2d8ed73, and now `make clean`
and `make distclean` fail since those jobs call `make -C runtime/indent
clean`
Remove call to `make -C runtime/indent clean`
Problem: update command does not write new buffers that have
filenames but no corresponding file on disk, even when using ++p flag.
Solution: allow update to write when buffer has filename but file
doesn't exist.
Problem: Wrong display with 'smoothscroll' and long wrapped virtual
text at EOL.
Solution: Handle w_skipcol inside long wrapped virtual text at EOL
(zeertzjq).
closes: vim/vim#18408d9318acc02
Problem: The ops.c file is too big.
Solution: Move code for dealing with registers to a new file. (Yegappan
Lakshmanan, closesvim/vim#4982)
4aea03eb87
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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'.