aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/tabpage_spec.lua
Commit message (Collapse)AuthorAge
* fix(tabpage): focusing a tab while closing it, fails assert #41475Rob Pilling2026-08-28
| | | | | | | | | | | | | | | | | | | | | Problem: If an autocommand handler focuses the tab page we're closing during a `:tabonly` (with some conditions), we hit an assert failure in `win_close_othertab()`. For this to occur, we need: - `nvim_buf_delete()` to trigger `close_windows()` (as is done in `cmdwin.lua`'s `_cleanup()`) - `close_windows()` then calls `win_close_othertab()`, removing the window (`win_free_mem()`) - then in the caller, `tabpage_close_other()`, the loop continues (we don't detect `tp_lastwin == wp` since we've unlinked the window) - the loop assumes that `curtab != tp` but we've refocused `curtab` so the `ex_win_close()` call passes `tp` as `curtab`, causing the assert to fail Solution: Detect the focus of `curtab` and abort closing the tab.
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* feat(api): tab-local option scope #39811Justin M. Keyes2026-05-17
| | | | | | | | | | | | | | | | | | Problem: 2d795face6e4 added support for tab-local options ('cmdheight') to `nvim_get_option_value`, but not to: nvim_get_option_info2() nvim_set_option_value(…, { tab = … }) gettabwinvar() Solution: - Update `options.lua` to model tab-local options. Introduce `kOptScopeTab`. - Handle tab scope in the options layer so it works for all options APIs. Note: - No change to `gettabvar()`. Not sure if needed/wanted. fix https://github.com/neovim/neovim/issues/31140
* fix(eval): 0 should mean current tabpage in gettabvar() (#36891)zeertzjq2025-12-10
| | | This matches the gettabvar() behavior change in Vim 8.1.1218.
* fix(window): handle closing the only non-float in other tabpageSean Dewar2025-07-22
| | | | | | | | | | | | | | Problem: No check for closing the only non-floating window in a non-current tabpage that contains floats. This can lead to a tabpage that contains only floats, causing crashes. Solution: Copy the relevant check from win_close to win_close_othertab. Fix some uncovered issues. Closes #34943 Fixes #31236 Co-authored-by: glepnir <glephunter@gmail.com>
* 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(tests): more global highlight definitionsbfredl2024-05-26
|
* 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.
* test: use integers for API Buffer/Window/Tabpage EXT typesLewis Russell2024-01-16
|
* 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
|
* 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
* fix: avoid unsigned overflow in home_replace() (#20854)zeertzjq2022-10-30
|
* test(tabpage_spec): actually test for nvim_win_hidezeertzjq2022-09-23
|
* test: add tests for #13549 #20285 #20290zeertzjq2022-09-23
|
* fix(ui): set redraw_cmdline when setting window height (#19630)zeertzjq2022-08-03
|
* fix(tabpage): check if ROWS_AVAIL changed for resize (#19620)zeertzjq2022-08-02
| | | | | | | | | N/A patches for version.c: vim-patch:9.0.0135: comment about tabpage line above the wrong code Problem: Comment about tabpage line above the wrong code. Solution: Move the comment. (closes vim/vim#10836) https://github.com/vim/vim/commit/0b0ccbbfb014e1c9682b86a7a41ff2837b0b8047
* fix(cmd): make :-tabmove work with modifiers (#18447)Marco Hinz2022-05-12
| | | | | | | | | `:tabmove` takes either an argument (`:tabmove -`) or an address (`:-tabmove`). The code assumed that `:tabmove` is the first command on the cmdline, but that is not the case when using additional modifiers like `:silent`. Make the addr parsing more robust by searching the command first, then going back to check for a potential address `-`.
* fix(tabpage): correct check for failure to close windowzeertzjq2022-03-27
| | | | Avoid closing window 999 times.
* test: reorg #15698Justin M. Keyes2021-09-17
Problem: Subdirectories like "visual", "insert", "normal" encourage people to separate *related* tests for no good reason. Typically the _mode_ is not the relevant topic of a test (and when it is, _then_ create an appropriate describe() or it()). Solution: - Delete the various `test/functional/<mode>/` subdirectories, move their tests to more meaningful topics. - Rename `…/normal/` to `…/editor/`. - Move or merge `…/visual/*` and `…/insert/*` tests into here where appropriate. - Rename `…/eval/` to `…/vimscript/`. - Move `…/viml/*` into here also. * test(reorg): insert/* => editor/mode_insert_spec.lua * test(reorg): cmdline/* => editor/mode_cmdline_spec.lua * test(reorg): eval core tests => eval_spec.lua