summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/editor/completion_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-20refactor(test): drop deprecated exc_exec #39242Justin M. Keyes1
2026-04-14docs: lsp, options, api #38980Justin M. Keyes1
docs: lsp, options - revert bogus change to `_meta/builtin_types.lua` from 3a4a66017b74 Close #38991 Co-authored-by: David Mejorado <david.mejorado@gmail.com>
2026-04-14fix(completion): preselect ignores completeopt flag #39030glepnir1
Problem: compl_preselect_match is set even when completeopt doesn't include preselect. Solution: Check kOptCotFlagPreselect in ins_compl_add before setting compl_preselect_match.
2026-04-13feat(completion): completeopt=preselect, LSP CompletionItem.preselect #36613glepnir1
Problem: LSP CompletionItem.preselect is not supported. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionClientCapabilities Solution: - Add "preselect" field to complete-items and "preselect" flag to 'completeopt'. - Set preselectSupport=true in LSP client capabilities.
2026-01-28fix(tui): log chdir failure properly #37591zeertzjq1
2026-01-09vim-patch:9.1.2064: completion: segfault during file name completion (#37316)zeertzjq1
Problem: completion: segfault during file name completion Solution: Initialize compl_num_bests (Girish Palya) closes: vim/vim#19134 https://github.com/vim/vim/commit/4895ae8c0cd144c98cfb05e0162c2caac8f63c4c Co-authored-by: Girish Palya <girishji@gmail.com>
2025-10-31fix(completion): complete drive-letter filepath on Windows #3635311soda111
Problem: On MSWIN, file completion (CTRL-X CTRL-F) only works for the current drive (so not for actual absolute paths), since drive letters are never included in the completion pattern. e.g. when completing "F:\Hello" Nvim currently completes "\Hello" which is relative to the current drive/volume. vim solves this by adding ':' to the default 'isfname' value on mswin, but that causes issues as ':' is not a valid windows path char anywhere _except_ after the drive letter. Solution: detect drive letters in front of the path when creating the completion pattern.
2025-10-03vim-patch:9.1.1820: completion: some issues with 'acl' (#36007)zeertzjq1
Problem: completion: some issues with 'acl' when "preinsert" and "longest" is in 'completeopt' (musonius, after v9.1.1638) Solution: Fix various issues (see details below) (Girish Palya) This commit addresses multiple issues in the 'autocompletedelay' behavior with "preinsert" and "longest": - Prevents spurious characters from being inserted. - Ensures the completion menu is not shown until `autocompletedelay` has expired. - Shows the "preinsert" effect immediately. - Keeps the "preinsert" effect visible even when a character is deleted. fixes: vim/vim#18443 closes: vim/vim#18460 https://github.com/vim/vim/commit/f77c187277c3fd2af7a48f8b15093a3e40ca95a0 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-30vim-patch:9.1.1800: completion: strange behaviour with 'ac' ↵zeertzjq1
completeopt=longest,preinsert Problem: completion: strange behaviour with 'ac' completeopt=longest,preinsert (zeertzjq) Solution: Let preinsert take precedence (Girish Palya) fixes: vim/vim#18410 closes: vim/vim#18428 https://github.com/vim/vim/commit/d35e5e4237ec578962d3d577bc5a4e4f6bf4abb2 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-30vim-patch:9.1.1797: completion: autocompletion can be improvedzeertzjq1
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#18314 closes: vim/vim#18387 https://github.com/vim/vim/commit/c05335082adb21d99d96374779856444a3a0688f Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-21test: fix 'autocompletedelay' test flakiness (#35856)zeertzjq1
2025-09-21vim-patch:9.1.1779: completion: 'autocomplete' cannot be enabled per buffer ↵zeertzjq1
(#35853) Problem: completion: 'autocomplete' cannot be enabled per buffer (Tomasz N) Solution: Make 'autocomplete' global or local to buffer (Girish Palya) fixes: vim/vim#18320 closes: vim/vim#18333 https://github.com/vim/vim/commit/0208b3e80a080740ff77a5661d0f65090e317d90 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-19vim-patch:9.1.1772: completion: inconsistent selection of first item with ↵zeertzjq1
'autocomplete' (#35835) Problem: completion: inconsistent selection of first item with 'autocomplete' (Tomasz N) Solution: Check for 'autocomplete' option in ins_compl_new_leader() (Girish Palya). fixes: vim/vim#18326 closes: vim/vim#18329 https://github.com/vim/vim/commit/86e8e909f2e8cc1f851b4b62c3060c86c1afae65 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-11vim-patch:9.1.1750: completion: preinserted text highlighed using ComplMatchInszeertzjq1
Problem: completion: preinserted text highlighed using ComplMatchIns Solution: Use highlighting group PreInsert and update the documentation (Girish Palya). When "preinsert" is included in 'completeopt', only the PreInsert highlight group should be applied, whether autocompletion is active or not. Previously, ComplMatchIns was used when autocompletion was not enabled. Related to https://github.com/vim/vim/pull/18213. closes: vim/vim#18254 https://github.com/vim/vim/commit/2525c56e423b3ddce8de925f582b9c4d00079675 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-25test: increase timeout in 'autocompletedelay' test (#35467)zeertzjq1
Change timeout from 200ms to 400ms, which is still 100ms lower than the 'autocompletedelay' value.
2025-08-24vim-patch:9.1.1681: tests: no test for actually moving cursor with 'acl' ↵zeertzjq1
(#35452) Problem: tests: no test for actually moving cursor when menu is not open with 'autocompletedelay'. Solution: Use <Up> first in the test. Also remove two unnecessary <Esc>s in completion timeout test (zeertzjq). closes: vim/vim#18097 https://github.com/vim/vim/commit/e8b99ff6d58b69639c29756edbfc655af38f9f03
2025-08-23vim-patch:9.1.1657: Autocompletion adds delayzeertzjq1
Problem: Autocompletion adds delay (gcanat, char101, after v9.1.1638) Solution: Temporarily disable autocomplation (Girish Palya). related: vim/vim#17960 fixes: vim/vim#18022 closes: vim/vim#18048 https://github.com/vim/vim/commit/196c376682f9ebad0d13a8d5458accfb33372537 Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23vim-patch:9.1.1638: completion: not possible to delay the autcompletionzeertzjq1
Problem: completion: not possible to delay the autcompletion Solution: add the 'autocompletedelay' option value (Girish Palya). This patch introduces a new global option 'autocompletedelay'/'acl' that specifies the delay, in milliseconds, before the autocomplete menu appears after typing. When set to a non-zero value, Vim waits for the specified time before showing the completion popup, allowing users to reduce distraction from rapid suggestion pop-ups or to fine-tune the responsiveness of completion. The default value is 0, which preserves the current immediate-popup behavior. closes: vim/vim#17960 https://github.com/vim/vim/commit/a09b1604d4fe7516d87fbcbf2ffd2dc484799b23 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-09fix(cmdline): completion for command after :restart (#35256)zeertzjq1
2025-07-17vim-patch:9.1.1563: completion: ruler may disappear (#34977)zeertzjq1
Problem: The ruler disappears after typing the second character during insert mode completion, even when completion messages are suppressed ('shortmess' includes "c"). This makes the UI appear inconsistent. Solution: Ensure the ruler is restored during screen redraw when popup completion is active (Girish Palya). Notes: No new tests were added, as existing screen dump tests were updated to reflect the corrected behavior. closes: vim/vim#17770 https://github.com/vim/vim/commit/824286c9a727811ed93e4e2f4f10944f735436e7 Nvim already behaves correctly as the popup menu is a separate grid in the compositor. Co-authored-by: Girish Palya <girishji@gmail.com>
2025-07-13vim-patch:9.1.1539: completion: messages don't respect 'shm' setting (#34923)zeertzjq1
Problem: completion: messages don't respect 'shm' setting Solution: Turn off completion messages when 'shortmess' includes "c" (Girish Palya). `:set shortmess+=c` is intended to reduce noise during completion by suppressing messages. Previously, some completion messages still appeared regardless of this setting. This change ensures that **all** completion-related messages are suppressed when `'c'` is present in `'shortmess'`. Not entirely sure if the original behavior was intentional. If there's a reason certain messages were always shown, feel free to close this without merging. closes: vim/vim#17737 https://github.com/vim/vim/commit/fe1d3c8af764831aa51a8922ce24a7cfd9e6129d Co-authored-by: Girish Palya <girishji@gmail.com>
2025-05-28vim-patch:9.1.1408: not easily possible to complete from register content ↵glepnir1
(#34198) Problem: not easily possible to complete from register content Solution: add register-completion submode using i_CTRL-X_CTRL-R (glepnir) closes: vim/vim#17354 https://github.com/vim/vim/commit/0546068aaef2b1a40faa2945ef7eba249739f219
2025-04-25fix(ui): exclude unfocusable windows from 'complete' "w" completionLuuk van Baal1
Problem: As in f85bc41, assume unfocusable windows to be UI windows whose buffer content is unexpectedly included in 'complete' "w" completion. Solution: Exclude unfocusable windows when looping over windows.
2025-03-24fix(cmdline): cmdline completion of _defer_require() modules #33007phanium1
Problem: `:lua vim.lsp.c<tab>` does not list vim.lsp.completion in the completion list after 24cea4c7f7417c7fe99a98a0487f51dd68c4f409. Solution: - Always include `vim.lsp._submodule` keys in candidates. - Fixes `vim.lsp.c<tab>` -> `vim.lsp.completion`. - Eager-load `vim.lsp.completion` to get its completion. - Fixes `vim.lsp.completion.g<tab>` -> `vim.lsp.completion.get`.
2025-03-15refactor(test): deprecate n.feed_command() #32915Justin M. Keyes1
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()`.
2025-02-21test(completion_spec): make Enter test descriptions more accuratezeertzjq1
2025-02-21vim-patch:9.1.1121: Enter does not insert newline with "noselect"glepnir1
Problem: Enter does not insert newline with "noselect" when the pum is visible (lifepillar) Solution: When Enter is pressed and no complete-item is selected, ins_compl_prep returns false, and the edit function continues processing Enter to insert a new line. (glepnir) fixes: vim/vim#1653 closes: vim/vim#16653 https://github.com/vim/vim/commit/07f0dbe3aa326fdf4d0f1b1cf7d79df89e91fc6e Co-authored-by: glepnir <glephunter@gmail.com>
2025-01-05fix(api): nvim__complete_set requires completeopt=popup #31177glepnir1
Problem: If completeopt does not include "popup" flag, nvim__complete_set still auto-creates a floating preview window. Solution: Fail if completeopt does not include the "popup" flag.
2024-12-06fix(completion): avoid deleting text when completion leader changes #31448luukvbaal1
Problem: When completion leader changes, text that might be reinserted immediately after is deleted. This unnecessarily affects extmarks. #31387 restored the original extmarks but that prevents end_right_gravity marks from growing. Solution: Avoid deleting leader text that will be reinserted.
2024-12-05docs: graduate intro.txt to "flow layout" #31462Justin M. Keyes1
- move credits and backers to credits.txt
2024-12-02fix(extmark): builtin completion can still affect nearby extmarks #31387luukvbaal1
Problem: Built-in completion can still affect nearby extmarks. #31384 Solution: Restore extmarks when completion leader changes.
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
2024-09-01fix(completion): don't include <Lua function> in -complete= (#30209)zeertzjq1
2024-08-31fix(completion): fix inconsistent Enter behavior (#30196)zeertzjq1
Problem: Behavior of Enter in completion depends on typing speed. Solution: Don't make whether Enter selects original text depend on whether completion has been interrupted, which can happen interactively with a slow completion function.
2024-07-06fix(lua): don't include text after cursor in completion pattern (#29587)zeertzjq1
2024-06-18refactor(lua): remove unnecessary strlen() in nlua_expand_pat() (#29388)zeertzjq1
Also change the initial value of `status` to `FAIL`, as that'll avoid unnecessary assignments.
2024-06-18fix(lua): find length of completion prefix earlier (#29384)zeertzjq1
Do the expansion right after setting the expand context, so that the length of the completion prefix can be set, but don't do that directly in set_one_cmd_context(), as that's also called by getcmdcompltype().
2024-05-26refactor(tests): more global highlight definitionsbfredl1
2024-04-23test: improve test conventionsdundargoc1
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-01-30vim-patch:9.1.0065: Segfault with CompleteChanged autocommand (#27261)zeertzjq1
Problem: Segfault with CompleteChanged autocommand (markonm ) Solution: Test match->cp_prev for being NULL before accessing it closes: vim/vim#13929 https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: normalise nvim bridge functionsLewis Russell1
- remove helpers.cur*meths - remove helpers.nvim
2024-01-12test: typing for helpers.methsLewis Russell1
2024-01-12test: remove helpers.sleep()Lewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-28docs: convert BACKERS.md to backers.txtdundargoc1
There is no reason for this file to be in project root, which is crowded as is. This also fits nicely part of the ongoing work towards gathering as much of the documentation as possible into one place.
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
2023-11-29fix(extmark): restore extmarks when completing original textLuuk van Baal1