Problem: Buffer overflow in buf_write() when converting incomplete
multi-byte characters (Kevin Goodsell)
Solution: Make the buffer slightly larger
closes: vim/vim#19007f99de42a9f
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: bicep filetype used for 2 bicep file types
Solution: Detect *.bicepparam files as bicep-param filetype, include
new bicep-params and bicep filetype plugin
(Scott McKendry)
The bicep language server handles parameter files differently than
regular bicep files. Treating them the same at the editor level leads to
false positive diagnostics in the editor.
References:
Bicep Language Constants:
- 51392d32ca/src/Bicep.Core/LanguageConstants.cs (L23)
VS Code Extension definition:
- 51392d32ca/src/vscode-bicep/package.json (L47)closes: vim/vim#190264e722fdfdd
Co-authored-by: Scott McKendry <me@scottmckendry.tech>
Problem: 'fsync' option cannot be set per buffer
Solution: Make 'fsync' option global-local
(glepnir)
closes: vim/vim#190194d5b303726
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: When virtualedit is set to all, the cursor is supposed to be
permitted to reside anywhere, including on the virtual space
beyond the end of the buffer's text. Switching modes triggered
a routine that "fixed" a cursor that was past the end of the
line by shifting it back to the last actual character in the
line and compensating with a virtual column offset. While
visually identical, this re-encoding changed the underlying
byte index, causing position-reporting functions to return
inconsistent values after a mode change.
Solution: Skip this coordinate adjustment when virtual editing is fully
enabled. By treating the line terminator as a valid, stable
position, the cursor’s internal representation remains
unchanged when entering or exiting Visual mode, ensuring
consistent coordinate reporting. Add a regression test to
check this functionality.
(McAuley Penney)
fixes: vim/vim#16276closes: vim/vim#19009491f0fa457
Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
fix(pum): hide info window when insufficient space
Problem:
1. Info window was displayed even with insufficient space.
2. Tab characters counted as single cells.
Solution:
1. Hide window when space < 10 columns. Will be configurable
via completepopup width option in the future.
2. Use win_linetabsize over mb_string2cells.
Problem: tests: test_virtualedit.vim leaves swapfiles behind
Solution: Close open buffers using :bw! instead of :close!
a8a0ee5004
Co-authored-by: Christian Brabandt <cb@256bit.org>
Problem:
When the popupmenu has no border but includes a scrollbar, the info window
column is misaligned due to a missing column offset.
Solution:
Apply a one-column offset to the info window when the popup menu has no border
and a scrollbar is present.
Problem: Changing `src` of already installed plugin currently takes
effect immediately inside `vim.pack.add()` and acts as "delete and
later fresh install". Although more robust, this might lead to
unintentional data loss (since plugin is deleted) if the plugin was
manually modified or the new source is not valid.
Also this introduces unnecessary differentiation between "change
`version`" and "change `src`" of already installed plugin.
Solution: Require an explicit `vim.pack.update()` to change plugin's
source. It is done by conditionally changing `origin` remote of the
Git repo. The effect does not require update confirmation in order to
have new changes fetched from the new `src` right away.
If in the future there are more types of plugins supported (i.e. not
only Git repos), also do extra work (like delete + install) during
`vim.pack.update()`.
Problem: patterns after a buffer-local pattern in a comma-separated aupat are
ignored.
Solution: ensure pat refers to the original buffer after each pattern, not the
buflocal_pat buffer, and when printing make sure it's normalized for
each pattern, not just the first.
Also simplify the logic when printing all autocommands for an event, and ensure
headings aren't repeated for each event when printing autocommands.
Problem: getregionpos() depends on 'linebreak' setting
Solution: Reset linebreak setting temporarily (McAuley Penney)
When a line is wrapped on word boundaries, getregionpos() may report a
different end column for a visual block than the cursor position used to
define the selection.
Update the blockwise calculation in getregionpos() to use the same
wrapping assumptions as visual block mode, so the reported region
matches the selection boundaries.
Add a regression test that forces wrapping and checks that the end
position stays consistent under "setlocal wrap" and "setlocal
linebreak".
closes: vim/vim#190068ea0e7205c
Co-authored-by: McAuley Penney <jacobmpenney@gmail.com>
Problem: At "if(0) do if(0); while(0); else", else should be aligned
with outer if, but is aligned with inner if.
Solution: In function find_match, ignore "if" and "else" inside a
do-while loop, when looking for "if". (Anttoni Erkkilä)
closes: vim/vim#190049d661b057e
Co-authored-by: Anttoni Erkkilä <anttoni.erkkila@protonmail.com>
Problem: tests: "Xm4" test directory may not be deleted
Solution: Use "R" flag with mkdir() call to have the directory
recursively deleted at the end of function Test_m4_format()
(Muraoka Taro)
Test_m4_format in test_filetype.vim creates the "Xm4" directory with the
'D' flag. Then it creates two files in the "Xm4" directory. One of them,
"alocal.m4," was created with the 'D' flag, so it will disappear after
the test is complete. However, the other, "configure.ac," was created
without any flags, so it will remain even after the test is complete.
Because the parent directory "Xm4" was created with the 'D' flag, the
latter "configure.ac" remains and is not empty, so it will not be
deleted.
This forces the directory to be deleted regardless of its contents. As a
result, the two files "alocal.m4" and "configure.ac" created in the
directory are no longer needed, so they have been deleted.
closes: vim/vim#18995de37e7430a
Co-authored-by: Muraoka Taro <koron.kaoriya@gmail.com>
Problem: bpftrace files are not recognized from the hashbang line.
Solution: Add a hashbang check (Stanislaw Gruszka)
closes: vim/vim#18992f2814754c0
Co-authored-by: Stanislaw Gruszka <stf_xl@wp.pl>
Background:
Suppose a window has concealed lines, and sets conceallevel>2,
concealcursor="". The concealed lines are displayed if the window is
curwin and the cursor is on the those lines.
Problem:
line('w$', win) switches curwin to win, and then does validate_botline
for curwin. It computes botline assuming the concealed lines displayed,
resulting in a smaller value than the actual botline that the user sees.
Solution:
Evaluate line('w$', win) without switching curwin.
Apply similar changes to other functions that switches curwin.
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem: Vim9: :let will soon be disallowed.
Solution: Add v:disallow_let temporarily. Fix tests.
cfcd011fcd
The change to use checkforcmd() is already included in the port of patch
9.0.1505. This commit adds the missing :const check.
N/A patches:
vim-patch:8.2.1397: Vim9: return type of maparg() not adjusted for fourth arg
vim-patch:8.2.1623: Vim9: using :call where it is not needed
vim-patch:8.2.1766: Vim9: Some tests are still using :let
vim-patch:8.2.1788: Vim9: still allows :let for declarations
vim-patch:8.2.1882: Vim9: v:disallow_let is no longer needed
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: debug text misses one line of return statement.
Solution: Add a line when not at a debug instruction. (closesvim/vim#9137)
112bed0cbe
Vim9 test "Test_Debugger_break_at_return()" commented out
to avoid unexpected side-effects even if all other tests pass.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: :disass completion does not understand "s:".
Solution: Expand "s:" to a pattern. (closesvim/vim#8780)
47016f5772
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Vim9: completion for :disassemble is incomplete.
Solution: Recognize the "debug" and "profile" arguments.
4ee9d8e04d
Vim9 ":disassemble" is N/A.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Completion for :disas sorts local functions first.
Solution: Sort local functions last, like with :delfunc. (Naohiro Ono,
closesvim/vim#8860)
dfe04dbff5
Vim9 ":disassemble" is N/A
but "commented" test code is a hint for future patches.
Co-authored-by: naohiro ono <obcat@icloud.com>
Problem: error set by win_set_buf may leak if autocommands immediately close the
new window.
Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as
it's more important and will cause 0 to be returned)
Problem: split_disallowed seemingly exists to prevent issues from changing
frames to accomodate a split window, which doesn't apply to floats.
Solution: remove the restriction for nvim_open_win, but only for floats.
(continue to check b_locked_split though)
NOTE: like before, the buffer we check b_locked_split for may not actually be
the target buffer "buf", as the later call to win_set_buf can fail to switch to
"buf" due to autocommands. (among other things)
Maybe we could attempt to close the new window in that case (or switch to a
different buffer if that also fails), but this is safer. (and simpler)
Fixes#36857 (and possibly some spurious E242s I've observed from extui)
Problem: After :botright copen and closing the quikfix window, the
cursor ends up in the wrong window. The problem is fr_child
always points to the first (leftmost for FR_ROW, topmost for
FR_COL) child frame. When do :vsplit, the new window is
created on the left, and frame_insert() updates the parent's
fr_child to point to this new left window.
Solution: Create a snapshot before open the quickfix window and restore
it when close it (glepnir).
closes: vim/vim#18961b43f9ded7e
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].
Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
Problem:
Tests that trigger `os_delay` messages may take 1-3 seconds, wasting
build/CI time, since this serves no purpose in tests.
Solution:
- Introduce `msg_delay` for cases where `os_delay` is being used as
a "UI feature".
- Skip `msg_delay` in tests.
Problem: Converting a funcref to a string leaves out "g:", causing the
meaning of the name depending on the context.
Solution: Prepend "g:" for a global function.
c4ec338fb8
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Problem: Not enough tests for :setlocal omnifunc (after 9.1.1991).
Solution: Move the last :new after :setlocal. Also test with 'complete'
(zeertzjq).
closes: vim/vim#18958cedb1a3171
Problem: :setlocal changes effective global 'omnifunc' (Maxim Kim)
Solution: Don't change global callback when using :setlocal (zeertzjq).
fixes: vim/vim#18948closes: vim/vim#189513e82b0ebfe
Problem:
The q keymap is already set in open_floating_preview, so maparg('q') is not empty.
Solution:
Add a health.style check before setting the q keymap.
Problem: Invalid memory access in Ex mode with global command.
Solution: Make sure the cursor is on a valid line. (closesvim/vim#7238)
3b6d57f2ce
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: When fuzzy is enabled and the prefix is not empty,
items are not sorted by fuzzy score before calling fn.complete.
Solution: Use matchfuzzypos to get the scores and sort the items
by fuzzy score before calling fn.complete.
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
claims to be a "data-only" plugin, in fact it still provides some
user-facing commands because they haven't been upstreamed to Nvim.
Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
restart`, `:lsp start` and `:lsp stop` respectively.
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
CursorLine background check used global `normal_bg`, ignoring 'winhighlight'.
Solution:
Use `bg_attr` to get window-local Normal background instead.