aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* vim-patch:9.1.1173: filetype: ABNF files are not detected (#32751)zeertzjq2025-03-06
| | | | | | | | | | | | | | | Problem: filetype: ABNF files are not detected Solution: detect '.abnf' file as abnf filetype and include an abnf syntax plugin (A4-Tacks). References: - RFC5234 - RFC7405 closes: vim/vim#16802 https://github.com/vim/vim/commit/9f827ec58728c4ea55a8d71d40a283ca2ce5b058 Co-authored-by: A4-Tacks <wdsjxhno1001@163.com>
* fix(terminal): improve cursor refresh handling (#32596)Sean Dewar2025-03-06
| | | | | | | | | | | | | | | | | Problem: terminal mode cursor refresh logic has too many edge cases where it fails when events change curbuf. Solution: change the logic. Introduce cursor_visible to TerminalState to more reliably track if terminal mode has changed busy. Move visibility handling to refresh_cursor and move its call in refresh_terminal to terminal_check to avoid temporarily changed curbufs from influencing cursor state. This has the effect of "debouncing" shape/visibility updates to once per terminal state tick (with the final attributes taking effect, as expected). I think this is OK, but as a result it may also be warranted to update when redrawing during the same state tick (e.g: from events executing :redraw); this can be added later, if wanted. Also move previous tests to a more appropriate place.
* feat(lsp): support for resolving code action command (#32704)Maria José Solano2025-03-06
| | | | | * fix(lsp): don't call codeAction_resolve with commands * feat(lsp): support for resolving code action command
* vim-patch:9.1.1176: wrong indent when expanding multiple lines (#32746)zeertzjq2025-03-06
| | | | | | | | | | Problem: wrong indentation of lastline when expanding multiple lines Solution: Check OPENLINE_FORCE_INDENT flag in open_line() (glepnir) closes: vim/vim#16786 https://github.com/vim/vim/commit/34a7d82aaed9836174f4ea84af047db3fdf6c8b3 Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1175: inconsistent behaviour with exclusive selection and ↵zeertzjq2025-03-06
| | | | | | | | | | | | | | | | motion commands (#32745) Problem: inconsistent behaviour with exclusive selection and motion commands (aidancz) Solution: adjust cursor position when selection is exclusive (Jim Zhou) fixes: vim/vim#16278 closes: vim/vim#16784 https://github.com/vim/vim/commit/c8cce711dde2d8abcf0929b3b12c4bfc5547a89d Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
* vim-patch:9.1.1174: tests: Test_complete_cmdline() may fail (#32743)zeertzjq2025-03-05
| | | | | | | | | | | | | Problem: tests: when the file 'TestCommand?Test' exists, 'Test_complete_cmdline()' will fail when writing the file. And there's no related cleaning operation for this kind of file before the test run. Solution: modify `write` to `write!` to override (Jim Zhou). closes: vim/vim#16799 https://github.com/vim/vim/commit/f7087cbec7ec1d32465c2460f2665725c8d3a06a Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
* vim-patch:9.1.1172: [security]: overflow with 'nostartofline' and Ex command ↵zeertzjq2025-03-06
| | | | | | | | | | | in tag file (#32739) Problem: heap-buffer-overflow with 'nostartofline' and Ex command in tag file. Solution: Set cursor column when moving cursor to line 1 (zeertzjq). closes: vim/vim#16796 https://github.com/vim/vim/commit/3ed6659549e447ff00def8edc841321e497f70a8
* feat(terminal)!: include cursor position in TermRequest event data (#31609)Gregory Anders2025-03-05
| | | | | | | | | | | | | | | | | | When a plugin registers a TermRequest handler there is currently no way for the handler to know where the terminal's cursor position was when the sequence was received. This is often useful information, e.g. for OSC 133 sequences which are used to annotate shell prompts. Modify the event data for the TermRequest autocommand to be a table instead of just a string. The "sequence" field of the table contains the sequence string and the "cursor" field contains the cursor position when the sequence was received. To maintain consistency between TermRequest and TermResponse (and to future proof the latter), TermResponse's event data is also updated to be a table with a "sequence" field. BREAKING CHANGE: event data for TermRequest and TermResponse is now a table
* fix(lua): format errors from luv callbacks using __tostringbfredl2025-03-05
|
* vim-patch:9.1.1170: wildmenu highlighting in popup can be improved (#32728)zeertzjq2025-03-04
| | | | | | | | | | | | | | | | | | | | | | | Problem: wildmenu highlighting in popup can be improved Solution: Check if the completion items contain submatches of the entered text (Girish Palya). This update enables highlighting in the popup menu even when the matched fragment or pattern appears within an item (string) rather than only at the beginning. This is especially useful for custom completion, where menu items may not always start with the typed pattern. For specific use cases, refer to the two examples in https://github.com/vim/vim/pull/16759 A sliding window approach is used with direct string comparison. Performance is not a concern, as highlighting is applied only to displayed lines, even if the menu list is arbitrarily long. closes: vim/vim#16785 https://github.com/vim/vim/commit/4ec46f32102e5569b247840e05a99221747a9381 Co-authored-by: Girish Palya <girishji@gmail.com>
* vim-patch:9.1.1171: tests: wrong arguments passed to assert_equal() (#32727)zeertzjq2025-03-05
| | | | | | | | | Problem: tests: wrong arguments passed to assert_equal() (after v9.1.1167). Solution: Swap arguments in the assert_equal() call (zeertzjq). closes: vim/vim#16782 https://github.com/vim/vim/commit/a95085e0fc2e46c7136982e8ba1ae91375991bfd
* fix(display): adjust winline info for concealed lines below last line (#32708)luukvbaal2025-03-04
| | | | | | | Problem: Last line in a window does not store correct `wl_lastlnum` if lines below it are concealed (resulting in e.g. incorrect cursor row). Solution: Increment `wl_lastlnum` while it points to a line above a concealed line.
* fix(lsp): open_floating_preview() ignores max_height (#32716)Robert Muir2025-03-04
| | | | | | | Problem: After 47aaddfa the max_height option is no longer respected. Hover documentation and Signature help windows take up the entire text height. Solution: Compare to window's current height and only modify the height if it would reduce the height, not enlarge it.
* fix(diagnostic): virtual_lines diagnostic columns (#32703)James Trew2025-03-04
| | | | | When multiple diagnostics appear on a single line, the virtual lines for all diagnostics except the first were rendered with progressively fewer columns.
* refactor(tests): use new-style highlight spec in legacy/bfredl2025-03-04
|
* vim-patch:9.1.1167: mark '] wrong after copying text object (#32712)zeertzjq2025-03-04
| | | | | | | | | | | | Problem: mark '] wrong after copying text object (ubaldot) Solution: Adjust position of '] for non-linewise, exclusive motions (Jim Zhou) related: vim/vim#16679 closes: vim/vim#16772 https://github.com/vim/vim/commit/360a39ae6c823dd3e3c89c209b544f345c6d86dd Co-authored-by: Jim Zhou <jimzhouzzy@gmail.com>
* vim-patch:9.1.1166: command-line auto-completion hard with wildmenuTomas Slusny2025-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: command-line auto-completion hard with wildmenu Solution: implement "noselect" wildoption value (Girish Palya) When `noselect` is present in `wildmode` and 'wildmenu' is enabled, the completion menu appears without pre-selecting the first item. This change makes it easier to implement command-line auto-completion, where the menu dynamically appears as characters are typed, and `<Tab>` can be used to manually select an item. This can be achieved by leveraging the `CmdlineChanged` event to insert `wildchar(m)`, triggering completion menu. Without this change, auto-completion using the 'wildmenu' mechanism is not feasible, as it automatically inserts the first match, preventing dynamic selection. The following Vimscript snippet demonstrates how to configure auto-completion using `noselect`: ```vim vim9script set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu autocmd CmdlineChanged : timer_start(0, function(CmdComplete, [getcmdline()])) def CmdComplete(cur_cmdline: string, timer: number) var [cmdline, curpos] = [getcmdline(), getcmdpos()] if cur_cmdline ==# cmdline # Avoid completing each character in keymaps and pasted text && !pumvisible() && curpos == cmdline->len() + 1 if cmdline[curpos - 2] =~ '[\w*/:]' # Reduce noise by completing only selected characters feedkeys("\<C-@>", "ti") set eventignore+=CmdlineChanged # Suppress redundant completion attempts timer_start(0, (_) => { getcmdline()->substitute('\%x00$', '', '')->setcmdline() # Remove <C-@> if no completion items exist set eventignore-=CmdlineChanged }) endif endif enddef ``` fixes: vim/vim#16551 closes: vim/vim#16759 https://github.com/vim/vim/commit/2bacc3e5fb3569e0fd98e129cb1e422ca18b80a6 Cherry-pick Wildmode_Tests() change from patch 9.0.0418. Co-authored-by: Girish Palya <girishji@gmail.com> Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* vim-patch:9.1.1165: diff: regression with multi-file diff blocks (#32702)zeertzjq2025-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vim's diff block merging algorithm when doing a multi-file diff is buggy when two different diff hunks overlap a single existing diff block (after v9.1.0743) Solution: fix a couple bugs in this logic: 1. Fix regression from v9.1.0743 where it's not correctly expanding the 2nd overlap correctly, where it always expands without taking into account that this was always taken care of when the first overlap happened. Instead, we should only grow the 2nd overlap if it overhangs outside the existing diff block, and if we encounter a new overlapping diff block (due to overlap chaining). 2. When we expand a diff block to match the hunk size on the orig side (when handling the first overlap), we expand the same amount of lines in the new side. This is not sound if there exists a second overlap hunk that we haven't processed yet, and that hunk has different number of lines in orig/new. Fix this by doing the corresponding counter adjustment when handling 2nd/3rd/etc overlap by calculating the difference in lines between orig and new side. (Yee Cheng Chin) closes: vim/vim#16768 https://github.com/vim/vim/commit/bc08ceb75572dcac57ef5019f3d0df6e8290c0f9 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* docs: misc #31996Justin M. Keyes2025-03-02
|
* feat(lua): don't complete private (_) fields after dot (.) #32690Maria José Solano2025-03-02
|
* feat(comment): allow commentstring to be determined from node metadataRiley Bruins2025-03-02
| | | | | | | | | | | **Problem:** Some weird languages have different comment syntax depending on the location in the code, and we do not have a way to determine the correct `commentstring` for these special cases. **Solution:** Allow queries to specify `commentstring` values in metadata, allowing users/`nvim-treesitter` to provide a better commenting experience without hugely increasing the scope of the code in core.
* test: simplify ASAN detectiondundargoc2025-03-02
|
* test: enable more multigrid popup tests (#32470)fredizzimo2025-03-02
|
* build!: turn off translations by defaultdundargoc2025-03-02
| | | | | The translation step prolongs the build time too much to be enabled by default. Enable it by passing cmake flag `ENABLE_TRANSLATIONS=ON`.
* vim-patch:9.1.1161: preinsert requires bot "menu" and "menuone" to be setzeertzjq2025-03-02
| | | | | | | | | | | | Problem: preinsert requires bot "menu" and "menuone" to be set, but "menu" is redundant (after v9.1.1160) Solution: preinsert only requires menuone (glepnir) closes: vim/vim#16763 https://github.com/vim/vim/commit/94a045ed56d7616c0cd0080d3f308d6cf9fbe64c Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1160: Ctrl-Y does not work well with "preinsert" when ↵zeertzjq2025-03-02
| | | | | | | | | | | | | | | | | | | | | completing items Problem: The 'preinsert' feature requires Ctrl-Y to confirm insertion, but Ctrl-Y only works when the popup menu (pum) is displayed. Without enforcing this dependency, it could lead to confusing behavior or non-functional features. Solution: Modify ins_compl_has_preinsert() to check for both 'menu' and 'menuone' flags when 'preinsert' is set. Update documentation to clarify this requirement. This avoids adding complex conditional behaviors. (glepnir) fixes: vim/vim#16728 closes: vim/vim#16753 https://github.com/vim/vim/commit/a2c5559f297a18dc1ce3c4f1f9fd6204aed321c9 Co-authored-by: glepnir <glephunter@gmail.com>
* feat(treesitter): add more metadata to `language.inspect()` (#32657)Lewis Russell2025-03-01
| | | | | | | | | Problem: No way to check the version of a treesitter parser. Solution: Add version metadata (ABI 15 parsers only) as well as parser state count and supertype information (ABI 15) in `vim.treesitter.language.inspect()`. Also graduate the `abi_version` field, as this is now the official upstream name. --------- Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* vim-patch:9.1.1158: :verbose set has wrong file name with :compiler! (#32682)zeertzjq2025-02-28
| | | | | | | | Problem: :verbose set has wrong file name with :compiler! Solution: Add -keepscript (zeertzjq) closes: vim/vim#16752 https://github.com/vim/vim/commit/5e8b2268e180cbf5079ea6dbe9c8fd29c3e3133c
* fix(marks): ineffective conceal_line callback optimization (#32662)luukvbaal2025-02-28
| | | | | | | Problem: _on_conceal_line callbacks are not invoked if callback has not let Nvim know it wants to receive them. But this may change on factors other than what is currently checked (changed buffer). Solution: Forego this optimization, callback is still guarded behind 'conceallevel'.
* vim-patch:8.2.4974: ":so" command may read after end of bufferzeertzjq2025-02-28
| | | | | | | | | Problem: ":so" command may read after end of buffer. Solution: Compute length of text properly. https://github.com/vim/vim/commit/4748c4bd64610cf943a431d215bb1aad51f8d0b4 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4647: "source" can read past end of copied linezeertzjq2025-02-28
| | | | | | | | | Problem: "source" can read past end of copied line. Solution: Add a terminating NUL. https://github.com/vim/vim/commit/2bdad6126778f907c0b98002bfebf0e611a3f5db Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4607: sourcing buffer lines may lead to errors for conflictszeertzjq2025-02-28
| | | | | | | | | | | | Problem: Sourcing buffer lines may lead to errors for conflicts. Solution: Add the ++clear argument. (Yegappan Lakshmanan, closes vim/vim#9991) https://github.com/vim/vim/commit/35dc17634dd6da5b90bd1b0160c4ed9e394f4b87 Documentation changes only. Vim9script is N/A. Cherry-pick another documentation change for :source from latest Vim. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4603: sourcing buffer lines is too complicatedzeertzjq2025-02-28
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Sourcing buffer lines is too complicated. Solution: Simplify the code. Make it possible to source Vim9 script lines. (Yegappan Lakshmanan, closes vim/vim#9974) https://github.com/vim/vim/commit/85b43c6cb7d56919e245622f4e42db6d8bee4194 This commit changes the behavior of sourcing buffer lines to always have a script ID, although sourcing the same buffer always produces the same script ID. vim-patch:9.1.0372: Calling CLEAR_FIELD() on the same struct twice Problem: Calling CLEAR_FIELD() on the same struct twice. Solution: Remove the second CLEAR_FIELD(). Move the assignment of cookie.sourceing_lnum (zeertzjq). closes: vim/vim#14627 https://github.com/vim/vim/commit/f68517c1671dfedcc1555da50bc0b3de6d2842f6 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4594: need to write script to a file to be able to source themzeertzjq2025-02-28
| | | | | | | | | | | | | Problem: Need to write script to a file to be able to source them. Solution: Make ":source" use lines from the current buffer. (Yegappan Lakshmanan et al., closes vim/vim#9967) https://github.com/vim/vim/commit/36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0 Most code and test changes are reverted or modified again in patch 8.2.4603, so only port parts that are untouched in patch 8.2.4603. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.1.1157: command completion wrong for input() (#32669)zeertzjq2025-02-28
| | | | | | | | | | | | | Problem: command completion wrong for input() (Cdrman Fu) Solution: Set commandline completion context explicitly (Jim Zhou) fixes vim/vim#16723 closes: vim/vim#16733 https://github.com/vim/vim/commit/3255af850e8bab35c30fce4177bb5ba4a941e6ce Co-authored-by: Jim Zhou <csd_189@163.com>
* vim-patch:9.1.1156: tests: No test for what patch 9.1.1152 fixes (#32668)zeertzjq2025-02-27
| | | | | | | | Problem: No test for what patch 9.1.1152 fixes. Solution: Add a test (zeertzjq). closes: vim/vim#16742 https://github.com/vim/vim/commit/4be1ab80befd78a80a05c2e66aeff58113832f46
* vim-patch:9.1.1155: Mode message not cleared after :silent message (#32667)zeertzjq2025-02-27
| | | | | | | | | | | Problem: Mode message not cleared after :silent message (after 9.0.1634). Solution: Don't reset mode_displayed when the message is empty. (zeertzjq) fixes: neovim/neovim#32641 closes: vim/vim#16744 https://github.com/vim/vim/commit/fce1fa5b618458f6f10028faadc9a9ddc227fe76
* fix(lua): wrong script context for option set by func from nvim_exec2 (#32659)zeertzjq2025-02-27
| | | | | | | | | Problem: Wrong script context for option set by function defined by nvim_exec2 in a Lua script. Solution: Call nlua_set_sctx() after adding SOURCING_LNUM and always set sc_lnum for a Lua script. This is a bug discovered when testing #28486. Not sure if this actually happens in practice, but it's easy to fix and required for #28486.
* fix(display): correctly store winline info for concealed lines (#32656)luukvbaal2025-02-27
| | | Off-by-one error in storing last line number for a logical line.
* fix(popup): reuse pum preview float win, set 'winfixbuf' #32636glepnir2025-02-27
| | | | | | | | | | | Problem: popup floating window is closed and recreated for each item selection, this is a bit wasteful. Solution: - Hide the preview win (instead of closing it) when the menu is still displayed: 1. When selected_item is -1. 2. When switching from an item with an "info" field to one without. - When pum is undisplayed it is still closed.
* fix(move): 'scrolloff' cursor correction no longer handles folds properly ↵luukvbaal2025-02-27
| | | | | | | (#32642) Problem: f58e7d5f passed `&botline` to `plines_win_full()`, (probably) assuming it would be set to the first line of the fold. Solution: Reinstate call to `hasFolding()` to do so.
* test: option set by Lua autocommand has correct script context (#32652)zeertzjq2025-02-27
|
* refactor(shada): fix coverity warning about leaking memory (#32650)zeertzjq2025-02-27
|
* test: unreliable swapfile_preserve_recover_specJustin M. Keyes2025-02-26
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Test sometimes fails on bsd (cirrus ci): test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: retry() attempts: 464 test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:590: Expected objects to be the same. Passed in: (table: 0x0d5f1aa44070) { [1] = '' *[2] = '' [3] = '[Process exited 1]' } Expected: (table: 0x0d5ea3eb8718) { [1] = '' *[2] = '[Process exited 1]' [3] = '' } stack traceback: test/testutil.lua:104: in function 'retry' test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:589: in function <test/functional/ex_cmds/swapfile_preserve_recover_spec.lua:556> Solution: Filter out empty items to avoid irrelevant redraw-timing assumptions.
* feat(lua): vim.text.indent()Justin M. Keyes2025-02-26
| | | | | | | | | | | | | Problem: Indenting text is a common task in plugins/scripts for presentation/formatting, yet vim has no way of doing it (especially "dedent", and especially non-buffer text). Solution: Introduce `vim.text.indent()`. It sets the *exact* indentation because that's a more difficult (and thus more useful) task than merely "increasing the current indent" (which is somewhat easy with a `gsub()` one-liner).
* fix(shada): ":wshada/:rshada [filename]" with shadafile=NONE #32538IpsumCapra2025-02-26
| | | | | | | | | | | Problem: read/write shada function logic was skipped entirely if it was detected the shadafile option was set to 'NONE'. Solution: The filename is now always resolved. When the shadafile option is set to 'NONE' AND no filename was passed, the filename resolves to an empty string, which causes the read/write functions to return. Regardless of whether the option is set to 'NONE', when a filename is explicitly passed, it gets resolved and the read/write logic is accessed.
* build: move all generator scripts to `src/gen/`Lewis Russell2025-02-26
| | | | | | | | | | | - Move all generator Lua scripts to the `src/gen/` - Add a `.luarc.json` to `src/gen/` - Add a `preload.lua` to `src/gen/` - Add `src` to `package.path` so it aligns with `.luarc.json' - Fix all `require` statements in `src/gen/` so they are consistent: - `require('scripts.foo')` -> `require('gen.foo')` - `require('src.nvim.options')` -> `require('nvim.options')` - `require('api.dispatch_deprecated')` -> `require('nvim.api.dispatch_deprecated')`
* fix(eval): don't shorten $HOME in v:stacktrace (#32634)zeertzjq2025-02-26
|
* fix(lua): don't override script ID from :source (#32626)zeertzjq2025-02-25
| | | | | | | | Problem: When setting an option, mapping etc. from Lua without -V1, the script ID is set to SID_LUA even if there already is a script ID assigned by :source. Solution: Don't set script ID to SID_LUA if it is already a Lua script. Also add _editor.lua to ignorelist to make script context more useful when using vim.cmd().
* fix(move): wrong cursor row on concealed line (#32629)luukvbaal2025-02-25
| | | | Problem: Cursor row calculation does not take into account concealed lines. Solution: Break the loop when the next calculated line is concealed.