aboutsummaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
...
* | test(old): sleep for 1 second on non-Windows in test_stat.vim (#28195)zeertzjq2024-04-06
| | | | | | | | | | Now that Nvim always supports nanotime, sleeping for some milliseconds is actually enough, but for test_stat.vim keeping some longer sleeps may increase test coverage, so just match the upstream test.
* | vim-patch:9.1.0269: Test for TextChanged is still flaky with ASANzeertzjq2024-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Test for TextChanged is still flaky with ASAN. Solution: Don't index the result of readfile(). (zeertzjq) It turns out that with ASAN the file may become empty during a write even if it's non-empty both before and after the write, in which case indexing the result of readfile() will error, so use join() instead. Also don't delete the file halfway the test, just in case it may cause errors on the next read. closes: vim/vim#14421 https://github.com/vim/vim/commit/e9ff79a7c9affea970f50de2aa65f62080b55323
* | vim-patch:9.1.0268: Two tests in test_filechanged.vim are slowzeertzjq2024-04-06
| | | | | | | | | | | | | | | | | | | | Problem: Two tests in test_filechanged.vim are slow. Solution: Sleep for shorter if the +nanotime feature is available. (zeertzjq) closes: vim/vim#14418 https://github.com/vim/vim/commit/83cd2c7bf0c12f05d747dd5fd6abfe103948bf12
* | feat(comment): add built-in commentingEvgeni Chasnovski2024-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Design - Enable commenting support only through `gc` mappings for simplicity. No ability to configure, no Lua module, no user commands. Yet. - Overall implementation is a simplified version of 'mini.comment' module of 'echasnovski/mini.nvim' adapted to be a better suit for core. It basically means reducing code paths which use only specific fixed set of plugin config. All used options are default except `pad_comment_parts = false`. This means that 'commentstring' option is used as is without forcing single space inner padding. As 'tpope/vim-commentary' was considered for inclusion earlier, here is a quick summary of how this commit differs from it: - **User-facing features**. Both implement similar user-facing mappings. This commit does not include `gcu` which is essentially a `gcgc`. There are no commands, events, or configuration in this commit. - **Size**. Both have reasonably comparable number of lines of code, while this commit has more comments in tricky areas. - **Maintainability**. This commit has (purely subjectively) better readability, tests, and Lua types. - **Configurability**. This commit has no user configuration, while 'vim-commentary' has some (partially as a counter-measure to possibly modifying 'commentstring' option). - **Extra features**: - This commit supports tree-sitter by computing `'commentstring'` option under cursor, which can matter in presence of tree-sitter injected languages. - This commit comments blank lines while 'tpope/vim-commentary' does not. At the same time, blank lines are not taken into account when deciding the toggle action. - This commit has much better speed on larger chunks of lines (like above 1000). This is thanks to using `nvim_buf_set_lines()` to set all new lines at once, and not with `vim.fn.setline()`.
* | feat(lsp): set workDoneToken in initialize request (#28182)Mathias Fußenegger2024-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Some servers don't report progress during initialize unless the client sets the `workDoneToken` See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress In particular: > There is no specific client capability signaling whether a client will > send a progress token per request. The reason for this is that this is > in many clients not a static aspect and might even change for every > request instance for the same request type. So the capability is signal > on every request instance by the presence of a workDoneToken property. And: > Servers can also initiate progress reporting using the > window/workDoneProgress/create request. This is useful if the server > needs to report progress outside of a request (for example the server > needs to re-index a database). The token can then be used to report > progress using the same notifications used as for client initiated > progress. So far progress report functionality was relying entirely on the latter. Solution: Set a `workDoneToken` Closes https://github.com/neovim/neovim/issues/27938
* | vim-patch:9.1.0265: console dialog cannot save unnamed buffers (#28185)zeertzjq2024-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: console dialog cannot save unnamed buffers Solution: set bufname before save (glepnir). Define dialog_con_gui to test for GUI+Console dialog support, use it to skip the test when the GUI feature has been defined. Note: The dialog_changed() function will also try to call the browse_save_fname() function, when FEAT_BROWSE is defined (which is only defined in a GUI build of Vim). This will eventually lead to a call of do_browse(), which causes an error message if a GUI is not currently running (see the TODO: in do_browse()) and will then lead to a failure in Test_goto_buf_with_onfirm(). Therefore, we must disable the Test_goto_buf_with_onfirm(), when the dialog_con_gui feature is enabled (which basically means dialog feature for GUI and Console builds, in contrast to the dialog_con and dialog_gui feature). (Previously this wasn't a problem, because the test aborted in the YES case for the :confirm :b XgotoConf case and did therefore not run into the browse function call) closes: vim/vim#14398 https://github.com/vim/vim/commit/df46115fc839c8912ed60646e86a412e5180ba1d Co-authored-by: glepnir <glephunter@gmail.com>
* | feat(defaults): add :Inspect to right-click menu (#28181)zeertzjq2024-04-05
| | | | | | | | | | | | | | Ref #21393 - Move default user commands to _defaults.lua as that now contains all kinds of defaults rather than just default mappings and menus. - Remove the :aunmenu as there are no menus when _defaults.lua is run.
* | vim-patch:8.1.0815: dialog for file changed outside of Vim not tested (#28184)zeertzjq2024-04-05
| | | | | | | | | | | | | | | | | | Problem: Dialog for file changed outside of Vim not tested. Solution: Add a test. Move FileChangedShell test. Add 'L' flag to feedkeys(). https://github.com/vim/vim/commit/5e66b42aae7c67a3ef67617d4bd43052ac2b73ce Co-authored-by: Bram Moolenaar <Bram@vim.org>
* | vim-patch:9.1.0262: Test for TextChanged is flaky with ASAN (#28180)zeertzjq2024-04-05
| | | | | | | | | | | | | | | | | | Problem: Test for TextChanged is flaky with ASAN. Solution: Wait for the file to be non-empty. (zeertzjq) closes: vim/vim#14404 https://github.com/vim/vim/commit/4a65391ca273f2eca84f5ec7bd846693232dfacc
* | test: reduce `exec_lua` callsdundargoc2024-04-04
|/ | | | | | | | | | | | | | | | | | | | | `exec_lua` makes code slighly harder to read, so it's beneficial to remove it in cases where it's possible or convenient. Not all `exec_lua` calls should be removed even if the test passes as it changes the semantics of the test even if it happens to pass. From https://github.com/neovim/neovim/pull/28155#discussion_r1548185779: "Note for tests like this, which fundamentally are about conversion, you end up changing what conversion you are testing. Even if the result happens to be same (as they often are, as we like the rules to be consistent if possible), you are now testing the RPC conversion rules instead of the vim script to in-process lua conversion rules." From https://github.com/neovim/neovim/pull/28155#discussion_r1548190152: "A test like this specifies that the cursor is valid immediately and not after a separate cycle of normal (or an other input-processing) mode."
* vim-patch:9.1.0259: Normal mode TextChanged isn't tested properly (#28167)zeertzjq2024-04-04
| | | | | | | | | | Problem: Normal mode TextChanged isn't tested properly. Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2() and also run it on Windows. Fix a typo in main.c. (zeertzjq) closes: vim/vim#14396 https://github.com/vim/vim/commit/c422662933275484e61af79d8148898337a5c38e
* Merge pull request #28156 from bfredl/attr_extendbfredl2024-04-03
|\ | | | | refactor(tests): allow to extend the new base set of attrs
| * refactor(tests): allow to extend the new base set of attrsbfredl2024-04-02
| | | | | | | | | | | | | | | | | | | | | | We start at 100 so we can make the base set larger if needed. (It might need to grow/shrink as a result of adopting the new default color scheme as the default for tests) Usage best illustrataded by example. Improving the workflow for making new tests with `screen:snapshot_util()` will be a follow up.
* | fix(stdpath): remove duplicate directories (#26653)Raphael2024-04-03
| |
* | vim-patch:9.1.0253: filetype: typespec files are not recognizedChristian Clason2024-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: filetype: typespec files are not recognized Solution: Detect '*.tsp' files as typespec (Hilmar Wiegand) Specs is at https://typespec.io/ closes: vim/vim#14392 https://github.com/vim/vim/commit/6c9f4f98f1cda3793406724a260cd651210a5d0d Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
* | vim-patch:9.1.0254: [security]: Heap buffer overflow when calling ↵zeertzjq2024-04-03
| | | | | | | | | | | | | | | | | | | | | | | | complete_add() in 'cfu' Problem: [security]: Heap buffer overflow when calling complete_add() in the first call of 'completefunc' Solution: Call check_cursor() after calling 'completefunc' (zeertzjq) closes: vim/vim#14391 https://github.com/vim/vim/commit/0a419e07a705675ac159218f42c1daa151d2ceea
* | vim-patch:9.0.0581: adding a character for incsearch fails at end of linezeertzjq2024-04-03
|/ | | | | | | | | Problem: Adding a character for incsearch fails at end of line. Solution: Only check cursor line number. https://github.com/vim/vim/commit/d4566c14e71c55dcef05fb34ea94eba835831527 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* test: silence expected errorsdundargoc2024-04-02
| | | | This will remove unrelated errors in .nvimlog at the end of test output.
* vim-patch:9.1.0251: Filetype test fails (#28142)zeertzjq2024-04-01
| | | | | | | | | | | | | Problem: Filetype test fails. Solution: Move detection by name before detection by extension. Improve TextChanged test and remove wrong test and fix a typo in a comment (zeertzjq). closes: vim/vim#14373 https://github.com/vim/vim/commit/8eb7523802cb51984e2202d08a4fbc1a2cd803c7 The changes to filetype.vim are N/A since Nvim always prefers filename matches to extension matches.
* vim-patch:9.0.1643: filetype detection fails if file name ends in many '~' ↵zeertzjq2024-04-01
| | | | | | | | | | | | | | (#28141) Problem: Filetype detection fails if file name ends in many '~'. Solution: Strip multiple '~' at the same time. (closes vim/vim#12553) https://github.com/vim/vim/commit/c12e4eecbb26cedca96e0810d3501043356eebaa In Nvim this already works as Lua filetype detection isn't subject to such a small recursion limit as autocommands, but it still makes sense to avoid unnecessary recursion. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.1.0250: filetype: ldscripts cannot be recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: ldscripts cannot be recognized Solution: Detect '*/ldscripts/*' as ld (Wu, Zhenyu) closes: vim/vim#14371 https://github.com/vim/vim/commit/4c7098b00a5edfb25b24fe3210866a4f30a2d78f Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0249: filetype: rock_manifest and config.ld files are not ↵Christian Clason2024-04-01
| | | | | | | | | | | | | | recognized Problem: filetype: rock_manifest and config.ld files are not recognized Solution: Detect 'rock_manifest' and 'config.ld' as lua (Wu, Zhenyu) closes: vim/vim#14370 https://github.com/vim/vim/commit/a917bd58bde0e1fca2affedc6fc0c15cb6b5e9f2 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0248: filetype: yarn lock files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: yarn lock files are not recognized Solution: Detect 'yarn.lock' files as yaml (Wu, Zhenyu) closes: vim/vim#14369 https://github.com/vim/vim/commit/3b497aa2470ff613fed79569bc8589dae8dc3190 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0247: filetype: bundle config files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: bundle config files are not recognized Solution: Detect '*/.bundle/config' as yaml (Wu, Zhenyu) closes: vim/vim#14368 https://github.com/vim/vim/commit/3f6fa93b3b7d8e0bd30eddbbf4ae273c14d4455b Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0246: filetype: fontconfig files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: fontconfig files are not recognized Solution: detect 'fonts.conf' as xml (Wu, Zhenyu) closes: vim/vim#14367 https://github.com/vim/vim/commit/a2c27b01dc344b16849721bd934779c627665364 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not ↵Christian Clason2024-04-01
| | | | | | | | | | | | | | | recognized Problem: filetype: zsh theme, history and zunit files are not recognized. Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh (Wu, Zhenyu) closes: vim/vim#14366 https://github.com/vim/vim/commit/a55a22a1a30f8f37633ed78ea25a393d11e250f2 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0244: filetype: bash history files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: bash history files are not recognized Solution: detect .bash-history and .bash_history files as bash (Wu, Zhenyu) closes: vim/vim#14365 https://github.com/vim/vim/commit/84ce55001af80d89245c4dd051c6f809389df62f Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0243: filetype: netrw history file is not recognizedChristian Clason2024-04-01
| | | | | | | | | | | Problem: filetype: netrw history file is not recognized Solution: Detect .netrwhist as vim files (Wu, Zhenyu) closes: vim/vim#14364 https://github.com/vim/vim/commit/abbb4a4f7032de9e223293182402af5e2867e372 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0242: filetype: octave history files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: octave history files are not recognized Solution: Detect octave/history files as octave (Wu, Zhenyu) closes: vim/vim#14363 https://github.com/vim/vim/commit/be71ac694f623e162f1ecb7a182bdf2fd281591f Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0241: filetype: mysql history files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: mysql history files are not recognized Solution: Detect .mysql_history as mysql (Wu, Zhenyu) closes: vim/vim#14362 https://github.com/vim/vim/commit/6b285c8cfd74e1da49fe17dca2ea9989bd9dae49 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0240: filetype: some python tools config files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: some python tools config files are not recognized Solution: Detect config files for setuptools, pudb, coverage as dosini (Wu, Zhenyu) closes: vim/vim#14361 https://github.com/vim/vim/commit/665220a17b830a271f0c7ef07211d25cd1c7b389 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0239: filetype: gnuplot history files are not recognisedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: gnuplot history files are not recognised Solution: detect .gnuplot_history files as gnuplot (Wu, Zhenyu) closes: vim/vim#14360 https://github.com/vim/vim/commit/8e47eb31cc8b29a223f1706730b8f4a5598d59ce Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0238: filetype: jupyterlab and sublime config are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | Problem: filetype: jupyterlab and sublime config are not recognized Solution: Detect jupyterlab and sublime config files as json (Wu, Zhenyu) closes: vim/vim#14359 https://github.com/vim/vim/commit/75c607dff7c9e02766ae0fd3588e08da00394d0f Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0237: filetype: mplstyle files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | Problem: filetype: mplstyle files are not recognized Solution: Detect '*.mplstyle' files as yaml (Wu, Zhenyu) closes: vim/vim#14358 https://github.com/vim/vim/commit/0fd560d46a1b83edba032300ab1f6119d4dca7b5 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0236: filetype: texlua files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | | Problem: filetype: texlua files are not recognized Solution: Add '*.tlu' pattern for texlua files (Wu, Zhenyu) Reference: https://github.com/TeX-Live/texdoc/tree/master/script closes: vim/vim#14357 https://github.com/vim/vim/commit/a75f4791b147db60a1d2744bb5ab7326e0c0edc0 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0235: filetype: supertux files are not recognizedChristian Clason2024-04-01
| | | | | | | | | | | | | | | Problem: filetype: supertux files are not recognized Solution: Supertux uses lisp to store hotkeys in config and game stage information, so add a pattern for supertux files. (Wu, Zhenyu) Reference: https://github.com/SuperTux/supertux/wiki/S-Expression closes: vim/vim#14356 https://github.com/vim/vim/commit/4ff83b904ea579e51a0da5d2c6c3873ccef4ac0e Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* vim-patch:9.1.0234: filetype: support for Intel HEX files is lackingChristian Clason2024-04-01
| | | | | | | | | | | | | | Problem: filetype: support for Intel HEX files is lacking Solution: Add more file extensions that are typical for Intel HEX files (Wu, Zhenyu) Reference: https://en.wikipedia.org/wiki/Intel_HEX closes: vim/vim#14355 https://github.com/vim/vim/commit/e523dd9803ed62ea0657af8c85ab7bdfe80f4c53 Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
* Merge pull request #28080 from echasnovski/intro-buf-changezeertzjq2024-04-01
|\ | | | | fix(intro): link showing intro to state at start
| * fix(intro): clear intro if new buffer is shown in focused floatEvgeni Chasnovski2024-03-29
| |
| * fix(intro): link showing intro to state at startEvgeni Chasnovski2024-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Current behavior of stateful intro message is too persistent. For example, it is still drawn if new empty buffer is shown in current window (either by explicitly setting it or after `tabnew`). Although the buffer is empty, the act of it being shown should be made visible. Solution: Make intro message persist if all is true: - Current buffer is the same as it was just after start, i.e. empty nameless with initial handle (i.e. 1). - Current window is the same as it was just after start, i.e. single non-floating with initial handle.
* | test(core/job_spec): skip exit test if "sleep" command missing (#28137)zeertzjq2024-04-01
| |
* | vim-patch:9.1.0232: Conceal test fails when rightleft feature is disabled ↵zeertzjq2024-04-01
| | | | | | | | | | | | | | | | | | | | | | | | (#28134) Problem: Conceal test fails when rightleft feature is disabled. Solution: Skip test if rightleft feature is missing (Julio B). closes: vim/vim#14342 https://github.com/vim/vim/commit/5df961a1bc5ed14d0b5aa04ef59e9079313c268d Co-authored-by: Julio B <julio.bacel@gmail.com>
* | vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in ↵zeertzjq2024-04-01
| | | | | | | | | | | | | | | | | | | | | | | | other buf (#28136) Problem: Filetype may be undetected when a SwapExists autocommand sets filetype in another buffer. Solution: Make filetype detection state buffer-specific. Also fix a similar problem for 'modified' (zeertzjq). closes: vim/vim#14344 https://github.com/vim/vim/commit/5bf6c2117fcef85fcf046c098dd3eb72a0147859
* | vim-patch:9.1.0230: TextChanged autocommand not triggered under some ↵zeertzjq2024-04-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | circumstances (#28135) Problem: TextChanged autocommand not triggered under some circumstances (Sergey Vlasov) Solution: Trigger TextChanged when TextChangedI has not been triggered fixes: vim/vim#14332 closes: vim/vim#14339 https://github.com/vim/vim/commit/86032702932995db74fed265ba99ae0c823cb75d Co-authored-by: Christian Brabandt <cb@256bit.org>
* | fix(api): set script context when using nvim_set_hl (#28123)zeertzjq2024-03-31
| |
* | feat(lua): pass keys before mapping to vim.on_key() callback (#28098)zeertzjq2024-03-31
| | | | | | Keys before mapping (i.e. typed keys) are passed as the second argument.
* | fix: explain that user should run nvim with -V1 to see more informationdundargoc2024-03-30
| | | | | | | | | | It's not obvious for users how to figure out where a mapping is set from only "Last set from Lua".
* | test: use matches(...) instead of ok(string.find(...)) (#28111)zeertzjq2024-03-30
| |
* | fix(extmarks): splice earlier when opening new line (#28108)zeertzjq2024-03-30
| | | | | | | | Related #26364 #26499 #26501 Fix #28107
* | fix: support UNC paths in vim.fs.normalizedundargoc2024-03-30
| | | | | | | | Closes https://github.com/neovim/neovim/issues/27068.