aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* 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.
* fix(treesitter): nil check query for has_conceal_lineLuuk van Baal2025-02-25
|
* test(ui/cursor_spec): reduce flakiness (#32627)zeertzjq2025-02-25
|
* fix(lsp): resize hover window for concealed linesLuuk van Baal2025-02-25
| | | | | | | | Problem: Height of a (markdown) `vim.lsp.util.open_floating_preview()` window can be reduced to account for concealed lines (after #31324). Solution: Set the window height to the text height of the preview window. Set 'concealcursor' to avoid unconcealing the cursorline when entering the hover window.
* feat(treesitter): vertical conceal support for highlighterLuuk van Baal2025-02-25
| | | | | | | | TSHighlighter now places marks for conceal_lines metadata. A new internal decor provider callback _on_conceal_line was added that instructs the highlighter to place conceal_lines marks whenever the editor needs to know whether a line is concealed. The bundled markdown queries use conceal_lines metadata to conceal code block fence lines.
* feat(marks): add conceal_lines to nvim_buf_set_extmark()Luuk van Baal2025-02-25
| | | | Implement an extmark property that conceals lines vertically.
* vim-patch:9.1.1140: filetype: m17ndb files are not detected (#32618)zeertzjq2025-02-25
| | | | | | | | | | | | | | | | | | | | Problem: filetype: m17ndb files are not detected Solution: detect m17ndb files as m17ndb filetype, include filetype, syntax and indent files for the new filetype (David Mandelberg). References: https://www.nongnu.org/m17n/manual-en/m17nDBFormat.html describes the format. https://git.savannah.nongnu.org/cgit/m17n/m17n-db.git/tree/ has examples of the files. closes: vim/vim#16696 https://github.com/vim/vim/commit/ed7d8e55ac232758fc14fd132994b4a09b19350b Also adjust the xkb parent pattern according to dev_vimpatch.txt. Co-authored-by: David Mandelberg <david@mandelberg.org>
* test: combined injections (#32611)Artem2025-02-25
| | | | | * refactor: rewrite test without trailing whitespace * test: combined injection tests
* vim-patch:9.1.1145: multi-line completion has wrong indentation for last ↵glepnir2025-02-25
| | | | | | | | | | | | line (#32625) Problem: When expanding omni completion items with newlines (e.g. `then\n\t\nend`), the end statement gets wrong indentation. Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use second_line_indent directly (glepnir) closes: vim/vim#16614 https://github.com/vim/vim/commit/5090a1fecb86c44be83d55e139ed79b7785fa090
* fix(api): don't override Vimscript SID (#32610)zeertzjq2025-02-25
| | | | | | | | | | Problem: When calling an API from Vimscript to set an option, mapping, etc., :verbose shows that it's set from an API client. Solution: Don't override current_sctx.sc_sid when calling an API from Vimscript. Also fix the inverse case where API channel id is not set when calling an API from RPC. Move channel id into sctx_T to make saving and restoring easier. Related #8329
* fix(lua): SIGSEGV in luv callback with error(nil) #32595phanium2025-02-24
| | | | | | | | | Problem: luv callback `vim.uv.new_timer():start(0, 0, function() error() end)` causes SIGSEGV, since `xstrdup` gets NULL from `lua_tostring`. Similar to: https://github.com/neovim/neovim/commit/a5b1b83a2693ffa7a5a0a22b3693d36ea60051be Solution: Check NULL before `xstrdup`.
* vim-patch:025dc48: runtime(vim): Update base-syntax, match :CompilerSet and ↵zeertzjq2025-02-24
| | | | | | | | | :SynMenu commands (#32605) closes: vim/vim#16713 https://github.com/vim/vim/commit/025dc48e88790133ef0da583b2ce5b9c2232ea9e Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:9.1.1143: illegal memory access when putting a register (#32604)zeertzjq2025-02-24
| | | | | | | | Problem: illegal memory access when putting a register Solution: make sure cursor column doesn't become negative https://github.com/vim/vim/commit/e0029daa3599529d9d438cc51c7ada8580297a39 Co-authored-by: Christian Brabandt <cb@256bit.org>
* feat(complete): CompleteDone reason "cancel", "discard" #32600Evgeni Chasnovski2025-02-23
| | | | | | | Problem: there is no way to distinguish between user's explicit completion stop/cancel and other automated reasons. Solution: update "cancel" reason to be set only on explicit CTRL-e, and set intentionally vague "discard" otherwise.
* fix(float): can set title/footer without setting border #32594Evgeni Chasnovski2025-02-23
| | | | | | | | | Problem: setting title and/or footer without explicitly setting border shows "title/footer/ requires border to be set" error. At the same time, explicitly setting `border = "none"` (which is default) shows expected no-border-no-title-no-footer window without error. Solution: allow setting title/footer without explicitly setting border.
* fix(float): ensure floating window width can fit titleMaria José Solano2025-02-23
|
* vim-patch:9.1.1139: [fifo] is not displayed when editing a fifozeertzjq2025-02-23
| | | | | | | | | | | | | Problem: [fifo] is not displayed when editing a fifo (after v7.4.2189) Solution: stat the filename and detect the type correctly fixes: vim/vim#16702 closes: vim/vim#16705 https://github.com/vim/vim/commit/f1c3134ee1f263e537212a3072e8aa4cb7e8d953 Co-authored-by: Christian Brabandt <cb@256bit.org>
* test(unit/strings_spec): show ctx when vim_snprintf content check fails #32570James McCoy2025-02-22
| | | | | | | | | | | | | | Same idea as a7be4b7bf857, but that only showed the context if the length of the string differed. Since these tests check both string length and string content, the ctx should be provided for both. ERROR test/unit/testutil.lua @ 797: vim_snprintf() positional arguments test/unit/testutil.lua:769: test/unit/testutil.lua:753: (string) ' test/unit/strings_spec.lua:159: snprintf(buf, 4, "%1$0.*2$b", 12ULL, cdata<int>: 0xf78c8ed8) = 001100 Expected objects to be the same. Passed in: (string) '000' Expected: (string) '001''
* vim-patch:9.1.1134: filetype: Guile init file not recognizedChristian Clason2025-02-23
| | | | | | | | | | | | | | | | | | | Problem: filetype: Guile init file not recognized Solution: detect '.guile' file as scheme filetype (David Mandelberg) References: https://www.gnu.org/software/guile/manual/html_node/Init-File.html > When run interactively, Guile will load a local initialization file > from ~/.guile. This file should contain Scheme expressions for > evaluation. closes: vim/vim#16683 https://github.com/vim/vim/commit/41a6026f007facb1ada3ff2a63a054913432860c Co-authored-by: David Mandelberg <david@mandelberg.org>
* vim-patch:9.1.1133: filetype: xkb files not recognized everywhereChristian Clason2025-02-23
| | | | | | | | | | | | | | | Problem: filetype: xkb files not recognized everywhere Solution: detect xkb files in more places (David Mandelberg) References: https://xkbcommon.org/doc/current/user-configuration.html#user-config-locations closes: vim/vim#16684 https://github.com/vim/vim/commit/b62bf814886185cb8607ce15051aa7017b8c88ba Co-authored-by: David Mandelberg <david@mandelberg.org>
* vim-patch:9.1.1135: 'suffixesadd' doesn't work with multiple items (#32573)zeertzjq2025-02-22
| | | | | | | | | | | Problem: 'suffixesadd' doesn't work with multiple items (after 9.1.1122). Solution: Don't concat multiple suffixes together. (zeertzjq) fixes: vim/vim#16694 closes: vim/vim#16699 https://github.com/vim/vim/commit/bf595ae4ac9ecc1e0620664177072926ed3679ff
* fix(lsp): unify get_completion_word for textEdits/insertTextMathias Fussenegger2025-02-22
| | | | | | | | | | | | | | Problem: After https://github.com/neovim/neovim/pull/32377 selecting snippets provided by luals inserted the multi-line text before accepting the candidates. That's inconsistent with servers who provide `textEdit` instead of `insertText` and having lines shift up/down while cycling through the completion candidates is a bit irritating. Solution: Use the logic used for `textEdit` snippets also for `insertText`
* fix(tests): filter out lines with __typeof__ keyword (#32524)Sören Tempel2025-02-22
| | | | | | | | Problem: On 32-bit architectures, musl libc makes heavy use of __typeof__ as part of its __REDIR macro for optional backwards compatibility with 32-bit time_t values. Unfortunately, the __typeof__ keyword is not supported by the LuaJIT C parser. Solution: Filter out the keyword in filter_complex_blocks.
* vim-patch:9.1.1132: Mark positions wrong after triggering multiline ↵zeertzjq2025-02-21
| | | | | | | | | | | | | completion (#32564) Problem: Mark positions wrong after triggering multiline completion. Solution: Call deleted_lines_mark() after deleting lines. (zeertzjq) closes: vim/vim#16687 https://github.com/vim/vim/commit/060e6556e2cd97512cee1f46bc7915768c0f9e21 Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
* fix(marks): truncate double-width inline virt_text consistently (#32560)zeertzjq2025-02-21
| | | | - Fix wrong cursor position with 'listchars' "precedes". - Always show the '<' truncation character.
* vim-patch:9.1.1130: 'listchars' "precedes" is not drawn on Tabs. (#32563)zeertzjq2025-02-21
| | | | | | | | | | Problem: 'listchars' "precedes" is not drawn on Tabs. Solution: Only draw 'listchars' "precedes" when not skipping over cells. (zeertzjq) fixes: vim/vim#5927 closes: vim/vim#16691 https://github.com/vim/vim/commit/13f100e9328b1344fec79806791eb3f5234d4ccc
* test: adjust multibyte virtual text test (#32557)zeertzjq2025-02-21
| | | | Having more chars after a double-width char makes it easier to spot the bug where truncating it causes the pending chars to be lost.
* fix(treesitter): `TSNode:field()` returns all children with the given fieldRiley Bruins2025-02-21
|
* perf(treesitter): only search for injections within the parse rangeRiley Bruins2025-02-21
| | | | Co-authored-by: Jaehwang Jung <tomtomjhj@gmail.com>
* fix(messages): list_cmd kind for :registers, :au[g] #32531luukvbaal2025-02-20
| | | | | | | | Problem: No kind for `:registers/autocmd/augroup` messages. `:registers` chunks are emitted as separate `msg_show` events. Solution: Add the `list_cmd` kind to the message. Introduce a new `msg_ext_skip_flush` variable to set to true around a group of to be paired message chunks.
* vim-patch:9.1.1127: preinsert text is not cleaned up correctly (#32544)zeertzjq2025-02-21
| | | | | | | | | | | | Problem: when 'completeopt' is set to preinsert the preinserted text is not cleared when adding new leader (Yee Cheng Chin) Solution: add a condition to delete preinsert text in edit function (glepnir) closes: vim/vim#16672 https://github.com/vim/vim/commit/52fd867f5e8a371653ee4fb6664593c82030f855 Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1125: cannot loop through pum menu with multiline items (#32543)zeertzjq2025-02-21
| | | | | | | | | | | | Problem: cannot loop through pum menu with multiline items with fuzzy and noselect in 'completeopt' (Tomasz N) Solution: remove unnecessary compl_no_select condition (glepnir) fixes: vim/vim#16641 closes: vim/vim#16674 https://github.com/vim/vim/commit/3af0a8d8f5b090a6a4b085e7b6ee0f5f87eda399 Co-authored-by: glepnir <glephunter@gmail.com>
* vim-patch:9.1.1126: patch 9.1.1121 used a wrong way to handle enterzeertzjq2025-02-21
| | | | | | | | | | | | Problem: patch 9.1.1121 used a wrong way to handle enter Solution: compl_enter_selects also needs to consider the selected item in ins_compl_new_leader() (glepnir) closes: vim/vim#16673 https://github.com/vim/vim/commit/44180416981000ad0bc5db4686889892e7a05cdd Co-authored-by: glepnir <glephunter@gmail.com>
* test(completion_spec): make Enter test descriptions more accuratezeertzjq2025-02-21
|