aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds
Commit message (Collapse)AuthorAge
* refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
|
* refactor(tests): merge n.spawn/n.spawn_argv into n.new_session #31859Justin M. Keyes2025-01-04
| | | | | | | | | | | | | | | | | Problem: - `n.spawn()` is misleading because it also connects RPC, it's not just "spawning" a process. - It's confusing that `n.spawn()` and `n.spawn_argv()` are separate. Solution: - Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`. This name aligns with the existing functions `n.set_session`/`n.get_session`. - Note: removes direct handling of `prepend_argv`, but I doubt that was important or intentional. If callers want to control use of `prepend_argv` then we should add a new flag to `test.session.Opts`. - Move `keep` to first parameter of `n.new_session()`. - Add a `merge` flag to `test.session.Opts` - Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait instead.
* feat(ui)!: emit prompt "messages" as cmdline events #31525luukvbaal2025-01-02
| | | | | | | Problem: Prompts are emitted as messages events, where cmdline events are more appropriate. The user input is also emitted as message events in fast context, so cannot be displayed with vim.ui_attach(). Solution: Prompt for user input through cmdline prompts.
* feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343Justin M. Keyes2024-12-19
| | | | | | | | | | | | Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | 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.
* refactor(test): rename alter_slashes, invert its behaviorJustin M. Keyes2024-09-09
| | | | | | | - `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`. - `alter_slashes` is an unusual name. Rename it to `fix_slashes`. - invert its behavior, to emphasize that `/` slashes are the preferred, pervasive convention, not `\` slashes.
* test: tmpname() can skip file creationJustin M. Keyes2024-09-02
|
* vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append ↵zeertzjq2024-08-02
| | | | | | | | | | | | | | | | (#29946) Problem: ex: trailing dot is optional for :g and :insert/:append Solution: don't break out early, when the next command is empty. (Mohamed Akram) The terminating period is optional for the last command in a global command list. closes: vim/vim#15407 https://github.com/vim/vim/commit/0214680a8ec5f7f656cb42e5db19243709202ed2 Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
* vim-patch:8.2.4065: computation overflow with large cound for :yankzeertzjq2024-07-14
| | | | | | | | | Problem: Computation overflow with large cound for :yank. Solution: Avoid an overflow. https://github.com/vim/vim/commit/3cf21b305104e91a28e4ce3a473672b2e88a9469 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(quickfix): make shortmess+=O work with cmdheight=0 (#29609)zeertzjq2024-07-08
|
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | 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.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* fix(api): set script context when using nvim_set_hl (#28123)zeertzjq2024-03-31
|
* 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
|
* refactor(tests): all screen tests should use highlightsbfredl2024-03-23
| | | | | | | | | | | | | | | | | | | | | | | This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
* vim-patch:9.1.0195: memleak with ex_drop, NULL dereferencezeertzjq2024-03-22
| | | | | | | | | | | | | Problem: memleak with ex_drop(), NULL dereference (zeertzjq) Solution: revert back to ex_rewind(), use curbuf instead of buf fixes: vim/vim#14246 closes: vim/vim#14251 https://github.com/vim/vim/commit/85a769d466d2009db6a318fd120d9691344664ba Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.1.0192: drop: don't rewind when editing the same filezeertzjq2024-03-22
| | | | | | | | | | | | | | Problem: :drop tries to :rewind the argumentlist, which results in E37 (after v9.1.0046) Solution: instead of calling ex_rewind(), call open_buffer() only when re-using the initial empty buffer fixes: vim/vim#14219 closes: vim/vim#14220 https://github.com/vim/vim/commit/978178823b7c62a0249411f3d1f584f8a3144c5d Co-authored-by: Christian Brabandt <cb@256bit.org>
* test: correct order of arguments to eq() (#27816)zeertzjq2024-03-11
|
* fix(process): start pty process eof timer on main thread (#27625)zeertzjq2024-02-26
|
* vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'zeertzjq2024-02-15
| | | | | | | | | | | | | | | Problem: Visual highlight hard to read with 'termguicolors' (Maxim Kim) Solution: Set Visual GUI foreground to black (with background=light) and lightgrey (with background=dark) (Maxim Kim) fixes: vim/vim#14024 closes: vim/vim#14025 https://github.com/vim/vim/commit/34e4a05d02a016fe230495be8f6c60ddd56f9567 Co-authored-by: Maxim Kim <habamax@gmail.com>
* refactor(tests): get channel id via nvim_get_chan_info #27441Justin M. Keyes2024-02-12
| | | Minor "best practices" nudge.
* vim-patch:9.1.0046: :drop does not re-use empty buffer (#27165)zeertzjq2024-01-24
| | | | | | | | | | | | | Problem: :drop does not re-use empty buffer (Rocco Mao) Solution: Make :drop re-use an empty buffer (Rocco Mao) fixes: vim/vim#13851 closes: vim/vim#13881 https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462 Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
* refactor: rewrite python provider in luadundargoc2024-01-22
|
* test: big cleanup followupLewis Russell2024-01-17
| | | | Followup to 07a7c0ec
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: normalise nvim bridge functionsLewis Russell2024-01-12
| | | | | - remove helpers.cur*meths - remove helpers.nvim
* test: typing for helpers.methsLewis Russell2024-01-12
|
* test: use vim.mpack and vim.uv directlyLewis Russell2024-01-12
|
* test: remove helpers.sleep()Lewis Russell2024-01-12
|
* test: do not inject vim module into global helpersLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | 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
* test: use termopen() instead of :terminal more (#26462)zeertzjq2023-12-08
|
* docs: small fixesdundargoc2023-10-10
| | | | | | Co-authored-by: Wansmer <wansmer@gmail.com> Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com> Co-authored-by: David Moberg <david.moberg@mediatek.com>
* feat: ignore swapfile for running Nvim processes #25336Justin M. Keyes2023-10-04
| | | | | | | | | | | | | | | | | | | Problem: The swapfile "E325: ATTENTION" dialog is displayed when editing a file already open in another (running) Nvim. Usually this behavior is annoying and irrelevant: - "Recover" and the other options ("Open readonly", "Quit", "Abort") are almost never wanted. - swapfiles are less relevant for "multi-Nvim" since 'autoread' is enabled by default. - Even less relevant if user enables 'autowrite'. Solution: Define a default SwapExists handler which does the following: 1. If the swapfile is owned by a running Nvim process, automatically chooses "(E)dit anyway" (caveat: this creates a new, extra swapfile, which is mostly harmless and ignored except by `:recover` or `nvim -r`. 2. Shows a 1-line "ignoring swapfile..." message. 3. Users can disable the default SwapExists handler via `autocmd! nvim_swapfile`.
* test: only trim trailing spaces in swapfile tests (#25341)zeertzjq2023-09-24
|
* fix(startup): stop TUI properly when quitting at swap dialog (#25337)zeertzjq2023-09-24
|
* fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes2023-06-22
| | | | followup to #24109 fix #16150
* fix(remote): make --remote-expr print to stdout (#23980)zeertzjq2023-06-11
|
* fix(helptags): make multibyte help tags work properly (#23975)zeertzjq2023-06-11
|
* feat(:source): source current ft=lua buffer as Lua code (#23802)zeertzjq2023-06-02
|
* test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque2023-05-22
| | | | `nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
* refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell2023-05-21
| | | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
* vim-patch:8.2.3887: E1135 is used for two different errorszeertzjq2023-05-08
| | | | | | | | | Problem: E1135 is used for two different errors. Solution: Renumber one error. https://github.com/vim/vim/commit/806da5176e9e9ab011d927c4ca33a8dde1769539 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.1978: making a mapping work in all modes is complicatedzeertzjq2023-05-08
| | | | | | | | | | | | | Problem: Making a mapping work in all modes is complicated. Solution: Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282, closes 4784, based on patch by Bjorn Linse) https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d Change docs to match Vim if it's wording is better. Change error numbers to match Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(excmd): append original command to error messagezeertzjq2023-05-05
| | | | | | | | | | Revert the change to do_cmdline_cmd() from #5226. This function is used in many places, so making it different from Vim leads to small differences from Vim in the behavior of some functions like execute() and assert_fails(). If DOCMD_VERBOSE really needs to be removed somewhere, a do_cmdline() call without DOCMD_VERBOSE is also shorter than a do_cmdline() call with DOCMD_VERBOSE.
* vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
* docs(powershell): use tee.exe instead of Tee-ObjectT7272023-04-22
| | | | | | | Problem: Tee-Object does not create a file if it does not receive input for example when :grep does not find matches. and so nvim tries to open a nonexistent errorfile causing an error. Solution: use tee.exe instead of Tee-Object