aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* vim-patch:9.1.1226: "shellcmdline" completion doesn't work with input() (#32998)zeertzjq2025-03-20
| | | | | | | | | | | | | | Problem: "shellcmdline" completion doesn't work with input(). Solution: Use set_context_for_wildcard_arg(). Fix indent in nextwild() (zeertzjq). There are some other inconsistencies for input() completion (ref vim/vim#948), but since "shellcmdline" currently doesn't work at all, it makse sense to at least make it work. fixes: vim/vim#16932 closes: vim/vim#16934 https://github.com/vim/vim/commit/7a5115ce50c622caf91503f9d7fe09c3749b928b
* fix(messages): incorrect error message splitting and kind #32990luukvbaal2025-03-19
| | | | | | | | | Problem: Message kind logic for emitting an error message is convoluted and still results in emitting an unfinished message earlier than wanted. Solution: Ensure emsg_multiline() always sets the kind wanted by the caller and doesn't isn't unset to logic for emitting the source message. Caller is responsible for making sure multiple message chunks are not emitted as multiple events by setting `msg_ext_skip_flush`...
* fix(snippet): wrong indentation when snippet contains "^" #32970Avinash Thakur2025-03-19
| | | | | | | | | | | | | | | | | | | | | | | ## Problem The pattern used to match indentation is wrong as can be seen in ```lua -- current pattern doesn't match starting space print(vim.inspect((" xyz"):match("(^%s+)%S"))) -- nil -- instead, it matches characters `^ ` in text print(vim.inspect(("x^ yz"):match("(^%s+)%S"))) -- "^ " -- indentation could've been matched by, however not required print(vim.inspect((" xyz"):match("^(%s+)%S"))) -- " " ``` ## Solution We don't even need to modify `base_indent` at every line. If every line's indentation is calculated by the previous line's indentation (which already has starting indentation) added to the starting indentation, we see that indentation is multiplied on every line. Hence, we only add the starting line indentation to every line.
* fix(filetype): normalize full path before matching #32227markstegeman2025-03-19
| | | | | | | | | | | | | Problem: On Windows, treesitter query files are not recognized as such when opened from inside their directory, because the full path returned from fnamemodify(_, ':p') contains backslashes, while the filetype patterns expect forward slashes. Solution: Normalize the result of fnamemodify(_, ':p') before trying to match it to filetype patterns. Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(api): don't use 'winborder' when reconfiguring float (#32984)glepnir2025-03-19
| | | | | | Problem: Reconfiguring a float window applies the global 'winborder'. Solution: - Ignore 'winborder' when reconfiguring a float window. - Still apply 'winborder' when converting a split to a float window.
* fix(marks): ensure decor is removed with proper range (#32973)luukvbaal2025-03-19
| | | | | | | Problem: Paired mark whose end is in front of its start should not have its decor removed (as fixed by 72f630f9), but may still need to have its range redrawn. Solution: Still call `buf_decor_remove()` but ensure it is not called with an inverse range when `extmark_del()` is called on an end mark.
* fix(api): fix 'winborder' preventing splits with nvim_open_win (#32981)zeertzjq2025-03-19
| | | | | | While at it, rename the p_winbd variable to p_winborder, as 'winbd' is not the option's short name. Co-authored-by: glepnir <glephunter@gmail.com>
* fix(options): fix 'winborder' accepting multiple string values (#32978)zeertzjq2025-03-19
| | | | | | Problem: 'winborder' accepting multiple string values. Solution: Use the fallback did_set_str_generic() callback instead of did_set_winborder() which calls opt_strings_flags() with incorrect last argument.
* vim-patch:9.1.1220: filetype: uv.lock file not recognized (#32955)Acaibrid2025-03-18
| | | | | | | | | Problem: filetype: uv.lock file not recognized Solution: detect uv.lock file as toml filetype (Acaibird) closes: vim/vim#16924 https://github.com/vim/vim/commit/18a6853a7627de231f0128237665112a0c8aaaf0
* vim-patch:9.1.1221: Wrong cursor pos when leaving Insert mode just after ↵zeertzjq2025-03-18
| | | | | | | | | | | | | | 'autoindent' (#32976) Problem: Wrong cursor position and '^' mark when leaving Insert mode just after 'autoindent' and cursor on last char of line. Solution: Don't move cursor to NUL when it wasn't moved to the left (zeertzjq). fixes: vim/vim#15581 related: neovim/neovim#30165 neovim/neovim#32943 closes: vim/vim#16922 https://github.com/vim/vim/commit/a3a7d10bfb9547991e04bcf12d1391deb8060754
* feat(float): add winborder option (#31074)glepnir2025-03-18
| | | | | | | | | Problem: There is currently no global option to define the default border style for floating windows. This leads to repetitive code when developers need consistent styling across multiple floating windows. Solution: Introduce a global option winborder to specify the default border style for floating windows. When a floating window is created without explicitly specifying a border style, the value of the winborder option will be used. This simplifies configuration and ensures consistency in floating window appearance. Co-authored-by: Gregory Anders <greg@gpanders.com>
* docs: misc #32959Justin M. Keyes2025-03-18
|
* fix(lua): ensure inspect_pos() only shows visible highlight extmarksLuuk van Baal2025-03-18
| | | | | | | | | | | | | | | Problem: Unpaired marks are shown with `filter.extmarks == true`, which should only return visible highlights. Misleading `end_col` included in `inspect_pos()` for unpaired mark; it is set to `start_col + 1` which would be a visible highlight, which it is not. Custom "is_here" filter used to get extmarks overlapping a position. Solution: Exclude unpaired highlight extmarks with `filter.extmarks == true`. Set `end_col` to `start_col` for an unpaired mark. Supply appropriate arguments to nvim_buf_get_extmarks() to return overlapping extmarks; exclude marks whose end is at `{row, col}` with `filter.extmarks == true`.
* test: cleanup ftplugin_spec.lua #32948Justin M. Keyes2025-03-17
| | | | | | | | Problem: - cannot run ftplugin_spec.lua by itself - test leaves foo/ dir Solution: - fix setup and teardown
* Merge pull request #32935 from zeertzjq/vim-3495497zeertzjq2025-03-18
|\ | | | | vim-patch: too many strlen() calls in edit.c
| * vim-patch:9.1.1216: Pasting the '.' register multiple times may not workzeertzjq2025-03-18
| | | | | | | | | | | | | | | | | | | | | | Problem: Pasting the '.' register multiple times may work incorrectly when the last insert starts with Ctrl-D and ends with '0'. (after 9.1.1212) Solution: Restore the missing assignment (zeertzjq). closes: vim/vim#16908 https://github.com/vim/vim/commit/61b354442418539056cc7073a9aec353d297836c
* | feat(runtime): Lua ftplugin 'includeexpr' #32719Phạm Bình An2025-03-17
|/ | | | | | | | | Problem: Current `'includeexpr'` in runtime/ftplugin/lua.vim doesn't work with Nvim Lua. Solution: Provide an improved 'includeexpr' for Lua in "ftplugin/lua.lua". Closes: https://github.com/neovim/neovim/issues/32490
* Merge pull request #32871 from ofseed/test-lspLewis Russell2025-03-17
|\ | | | | test(lsp): add some tests for LSP bugs
| * test(lsp): add a test for refreshing hints after being requestedYi Ming2025-03-17
| |
| * test(lsp): add a test for resetting the active request after receiving errorYi Ming2025-03-17
| |
* | refactor(lsp)!: rename lsp.completion.trigger() to get() (#32911)Mathias Fußenegger2025-03-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: `trigger` is a custom word not yet used in APIs. Solution: Use `get` instead because the main effect is that the completion candidates will be collected (and shown by default, but follow-up commits are planned to add an `on_result` callback that allows more general handling). --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* | fix(checkhealth): handle nested lua/ directory #32918phanium2025-03-16
| | | | | | | | | | | | Problem: :checkhealth fails if plugin has nested "lua/" directory Solution: trim `{runtimepath}/lua` from fullpath to get subpath (`./**/{health, health/init.lua}`)
* | refactor(test): move runtime_spec.lua to editor/ #32919Justin M. Keyes2025-03-16
| | | | | | | | | | | | | | | | Problem: The `lua/` tests dir is for Lua stdlib tests. It is not for anything that randomly happens to be implemented with Lua. Solution: Move `lua/runtime_spec.lua` to `editor/runtime_spec.lua`.
* | fix(marks): issues with invalid marks and marks beyond eob (#32862)luukvbaal2025-03-16
| | | | | | | | | | | | | | Problem: Marks that go beyond the end of the buffer, and paired marks whose end is in front of its start mark are added to and removed from the decor. This results in incorrect tracking of the signcolumn. Solution: Ensure such marks are not added to and removed from the decor.
* | refactor(test): deprecate n.feed_command() #32915Justin M. Keyes2025-03-15
| | | | | | | | | | | | | | | | | | | | | | Problem: `feed_command()` was added as a "bridge" for old test code. 99% of those cases should be using `n.command()`, which raises errors instead of silently continuing the test. Solution: Deprecate `feed_command()`. It should not be used in new tests. All usages of `feed_command()` should be converted to `command()` or `feed()`.
* | fix(statuscolumn): misleading v:lnum for virtual lines #32912luukvbaal2025-03-15
| | | | | | | | | | | | | | Problem: Virtual 'statuscolumn' lines are evaluated with a misleading v:(rel)num. Namely set to the line above for `virt_lines_above = true` lines, or even the last drawn line for a partial redraw. Solution: Set `v:lnum` for the first evaluated row of a line, first above virtual line of a row and first non-virtual line of a row.
* | docs: miscdundargoc2025-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Au. <acehinnnqru@gmail.com> Co-authored-by: Daniel Rainer <daniel.rainer@localhost> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: Luuk van Baal <luukvbaal@gmail.com> Co-authored-by: Pierre Barbin <pierre@heitzsystem.com> Co-authored-by: Riley Bruins <ribru17@hotmail.com> Co-authored-by: Yinzuo Jiang <jiangyinzuo@foxmail.com> Co-authored-by: phanium <91544758+phanen@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* | feat(defaults): completeopt=popup #32909Justin M. Keyes2025-03-15
| | | | | | | | Assuming that completeopt=popup does what its documentation claims, it is more appropriate that completeopt=preview as a default.
* | fix(cmdline): ext_cmdline block events for conditionalsLuuk van Baal2025-03-15
| | | | | | | | | | | | Problem: No block events emitted with ext_cmdline for :if, :while, :try etc. Solution: Emit cmdline block events; store the indent level of the previous cmdline and whether a block event was emitted.
* | test(old): fix test_tabline failure (#32907)zeertzjq2025-03-15
| | | | | | Also fix tests after test_sha256 in test_alot.vim being skipped.
* | vim-patch:9.1.1206: tests: test_filetype fails when a file is a directory ↵zeertzjq2025-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#32905) Problem: tests: test_filetype fails when a file is a directory (Eisuke Kawashima) Solution: When encountering a directory instead of a file, skip that particular filetype test fixes: vim/vim#16894 https://github.com/vim/vim/commit/63a885b6506ce90050c1e3515836db06853cd0d7 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | vim-patch:9.1.1205: completion: preinserted text not removed when closing ↵glepnir2025-03-15
| | | | | | | | | | | | | | | | | | | | pum (#32903) Problem: completion: preinserted text not removed when closing pum Solution: delete preinsert text inside in ins_compl_stop() (glepnir). closes: vim/vim#16891 https://github.com/vim/vim/commit/84a7503e29dc248661efc98b6c59d2e911452d5c
* | vim-patch:9.1.1204: MS-Windows: crash when passing long string to expand() ↵zeertzjq2025-03-15
| | | | | | | | | | | | | | | | | | | | | | | | (#32902) Problem: MS-Windows: crash when passing long string to expand() with 'wildignorecase'. Solution: Use the same buflen as unix_expandpath() in dos_expandpath(). Remove an unnecessary STRLEN() while at it (zeertzjq). closes: vim/vim#16896 https://github.com/vim/vim/commit/00a749bd90e6b84e7e5132691d73fe9aa3fdff05
* | vim-patch:9.1.1203: matchparen keeps cursor on case label in sh filetype ↵zeertzjq2025-03-15
|/ | | | | | | | | | | | | (#32900) Problem: matchparen keeps cursor on case label in sh filetype (@categorical, after 9.1.1187). Solution: Use :defer so that cursor is always restored, remove checks for older Vims, finish early if Vim does not support :defer fixes: vim/vim#16887 closes: vim/vim#16888 https://github.com/vim/vim/commit/47071c6076018cace96f6e567054a21c123d0c10
* test: do not dedent() in feed() (#32884)zeertzjq2025-03-14
| | | | Most callers of feed() do not expect feed() to dedent. Now use a literal space in tests where it looks better.
* test: flaky loop_spec.lua #32885Justin M. Keyes2025-03-14
| | | | | | | | | | | | | | | | | | | | Problem: Test may fail because it matches a Lua table address, and the following whitespace may differ depending on the stringified address length: test/functional/lua/loop_spec.lua:233: Row 3 did not match. Expected: |{3: }| |{9:Error executing callback:} | |*{9:uv_idle_t: 0x{MATCH:%w+}} | |{6:Press ENTER or type command to continue}^ | Actual: |{3: }| |{9:Error executing callback:} | |*{9:uv_idle_t: 0xd4c2820a00} | |{6:Press ENTER or type command to continue}^ | Solution: Match a variable amount of whitespace.
* feat(snippet): set snippet keymaps permanent instead of dynamic (#31887)Mathias Fußenegger2025-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>` keymaps there is no way to build "smart-tab" functionality where `<tab>` chooses the next completion candidate if the popup menu is visible. Solution: Set the keymap permanent in `_defaults`. The downside of this approach is that users of multiple snippet engine's need to adapt their keymaps to handle all their engines that are in use. For example: vim.keymap.set({ 'i', 's' }, "<Tab>", function() if foreign_snippet.active() then return "<Cmd>lua require('foreign_snippet').jump()<CR>" elseif vim.snippet.active({ direction = 1 }) then return "<Cmd>lua vim.snippet.jump(1)<CR>" else return key end end, { expr = true }) Upside is that using `vim.keymap.set` to override keymaps is a well established pattern and `vim.snippet.expand` calls made by nvim itself or plugins have working keymaps out of the box. Co-authored-by: Maria José Solano <majosolano99@gmail.com>
* vim-patch:9.1.1200: cmdline pum not cleared for input() completion (#32879)zeertzjq2025-03-13
| | | | | | | | | | | | | Problem: Cmdline pum not cleared for input() completion. Solution: Temporary reset RedrawingDisabled in cmdline_pum_cleanup(), like what is done in wildmenu_cleanup() (zeertzjq). fixes: vim/vim#16874 closes: vim/vim#16876 https://github.com/vim/vim/commit/1830e787f6ee9828151284c44b494b801c677ee9 No code change is needed in Nvim, as RedrawingDisabled does not prevent the compositor from removing a grid.
* fix(messages): no trailing newline for inputlist, tselect, z= with ext_messagesLuuk van Baal2025-03-13
| | | | | | | | | | Problem: Various list commands end in a newline to go to a new line on the message grid for the prompt message, which is unwanted with ext_messages. Solution: Don't emit a trailing newline with ext_messages for inputlist(), :tselect and z=. Co-authored-by: Tomasz N <przepompownia@users.noreply.github.com>
* vim-patch:9.1.1196: filetype: config files for container tools are not ↵zeertzjq2025-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | recognized (#32873) Problem: filetype: config files for container tools are not recognized Solution: detect the ones that aren't detected yet as toml filetype (David Mandelberg) The .containerignore format doesn't look exactly the same as gitignore, but very close. And .dockerignore is already using gitignore. References: https://github.com/containers/common/blob/main/docs/containerignore.5.md https://github.com/containers/common/blob/main/docs/containers.conf.5.md https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md I wasn't sure exactly how to interpret what containers.conf(5) was saying about modules, so I looked at https://github.com/containers/common/tree/main/pkg/config/testdata/modules to get examples, and based the detection off those. closes: vim/vim#16852 https://github.com/vim/vim/commit/7546afbf525861f586ea2deabf71e3a2940abd4d Co-authored-by: David Mandelberg <david@mandelberg.org>
* fix(lua): vim.hl.on_yank highlights wrong region with yi' (#32850)phanium2025-03-13
| | | | | | | Problem: yi' don't highlight last character since https://github.com/neovim/neovim/commit/8ce504820af04194a41acbe1f4c61cf12bd5feb5. Solution: Always use `opts.inclusive=true`, since calculation of `"]` (`b_op_end`) have taken `inclusive` into account.
* vim-patch:9.1.1198: [security]: potential data loss with zip.vim (#32867)zeertzjq2025-03-13
| | | | | | | | | | | | Problem: [security]: potential data loss with zip.vim and special crafted zip files (RyotaK) Solution: use glob '[-]' to protect filenames starting with '-' Github Advisory: https://github.com/vim/vim/security/advisories/GHSA-693p-m996-3rmf https://github.com/vim/vim/commit/f209dcd3defb95bae21b2740910e6aa7bb940531 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.1195: inside try-block: fn body executed with default arg ↵zeertzjq2025-03-13
| | | | | | | | | | | | | | | undefined (#32866) Problem: inside try-block: fn body executed when default arg is undefined Solution: When inside a try-block do not execute function body after an error in evaluating a default argument expression (Shane Harper). closes: vim/vim#16865 https://github.com/vim/vim/commit/2d18789aa67cc60072ea0cf21811c403fa0b2c7b Co-authored-by: Shane Harper <shane@shaneharper.net>
* test: reduce flakiness in blocking wait tests (#32868)zeertzjq2025-03-13
|
* fix: update osc52 termfeatures flag on UIEnter/UILeave (#32756)Gregory Anders2025-03-12
| | | | | | | | | Problem: Nvim tries to use OSC 52 even when no TUIs are attached. Solution: On each UIEnter/UILeave event, check that there is a TUI client connected to Nvim's stdout.
* fix(lsp): handle non-existent configs in lsp.config/enableLewis Russell2025-03-12
|
* feat(treesitter): allow disabling captures and patterns on TSQuery (#32790)Ian Chamberlain2025-03-11
| | | | | | | | | Problem: Cannot disable individual captures and patterns in treesitter queries. Solution: * Expose the corresponding tree-sitter API functions for `TSQuery` object. * Add documentation for `TSQuery`. * Return the pattern ID from `get_captures_at_pos()` (and hence `:Inspect!`).
* fix(lsp): improve LSP floating preview window cleanup #31353glepnir2025-03-11
| | | | | Problem: The current implementation creates a unique autocommand group for each floating preview window, which is inefficient and can lead to numerous autocommand groups. Solution: Use a single shared autocommand group with improved window validation to properly clean up LSP floating preview windows.
* vim-patch:9.1.1193: Unnecessary use of STRCAT() in au_event_disable() (#32829)zeertzjq2025-03-11
| | | | | | | | | | | | | Problem: Unnecessary use of STRCAT() in au_event_disable(). STRCAT() seeks to the end of new_ei, but here the end is already known. Solution: Use STRCPY() and add p_ei_len to new_ei. Also fix a typo in a comment. Add a test that 'eventignore' works in :argdo (zeertzjq). closes: vim/vim#16844 https://github.com/vim/vim/commit/969e11a18b145241dc0ab39fc1be7ed814655dfc Cherry-pick p_ei_len from patch 9.1.0256.
* fix(events): fix incorrect capitalization of Cmdwin* events (#32813)zeertzjq2025-03-11
| | | | | | The name of Cmdwin* events were changed to CmdWin* in 8ed2dbf6e2802516501c11e72e5d6d977e6a07f3 without explanation. This commit changes them back. This doesn't affect the creation or execution of autocommands. It only affects the listing of autocommands.