summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ui/screen_basic_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-13test(ui/screen_basic_spec): scrolling behind floating window #38993jdrouhard1
validate scrolling behavior in the presence of floating windows.
2025-12-10fix(grid): assert crash during extreme resize layouts #36847CompileAndConquer1
Problem: When the terminal shrinks, Neovim tries to recompute the layout and adjust every window so that the total width matches the new Columns. But in the scenario of numerous windows split horizontally, there is not enough space for all of them. The frame width (topframe->fr_width) never reaches the new Columns value, the logic tries to redistribute this negative space across child frames, but it triggers the assert. Solution: Skip this case in `win_update`.
2025-01-04refactor(tests): merge n.spawn/n.spawn_argv into n.new_session #31859Justin M. Keyes1
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.
2024-12-02fix(ui): clamp 'cmdheight' for other tabpages on screen resize (#31419)zeertzjq1
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-05-27fix(drawline): don't draw beyond end of window (#29035)zeertzjq1
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-03-26refactor(tests): use new global defaults instead of set_default_attr_idsbfredl1
This will be done in batches.
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: typing for helpers.methsLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-24refactor(options): remove side effects from `check_num_option_bounds()`Famiu Haque1
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-12-06test: 'nofsync' with deadly signal #26415Justin M. Keyes1
Problem: The test for 'nofsync' swapfile preservation on a deadly signal, does not actually assert anything. followup to 1fd29a28841dee3d25ff079eb24fc160eb02cb3c Solution: Check that swapfile contents are present after getting SIGTERM. TODO: this doesn't really verify that 'fsync' was called; it still passes with this patch: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..7a635520401d 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,7 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files + ml_sync_all(false, false, false); // preserve all swap files break; } } However it correctly fails with this patch, at least: diff --git a/src/nvim/main.c b/src/nvim/main.c index 216e39f3e81c..f2306c310ddc 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -838,7 +838,6 @@ void preserve_exit(const char *errmsg) if (errmsg != NULL) { os_errmsg("Vim: preserving files...\r\n"); } - ml_sync_all(false, false, true); // preserve all swap files break; } }
2023-12-02feat(highlight): update default color schemeEvgeni Chasnovski1
Problem: Default color scheme is suboptimal. Solution: Start using new color scheme. Introduce new `vim` color scheme for opt-in backward compatibility. ------ Main design ideas - Be "Neovim branded". - Be minimal for 256 colors with a bit more shades for true colors. - Be accessible through high enough contrast ratios. - Be suitable for dark and light backgrounds via exchange of dark and light palettes. ------ Palettes - Have dark and light variants. Implemented through exporeted `NvimDark*` and `NvimLight*` hex colors. - Palettes have 4 shades of grey for UI elements and 6 colors (red, yellow, green, cyan, blue, magenta). - Actual values are computed procedurally in Oklch color space based on a handful of hyperparameters. - Each color has a 256 colors variant with perceptually closest color. ------ Highlight groups Use: - Grey shades for general UI according to their design. - Bold text for keywords (`Statement` highlight group). This is an important choice to increase accessibility for people with color deficiencies, as it doesn't rely on actual color. - Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some minor text UI elements. - Cyan as main syntax color, i.e. for function usage (`Function` highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI elements. - Red to generally mean high user attention, i.e. errors; in particular for `ErrorMsg`, `DiffDelete`, `DiagnosticError`. - Yellow very sparingly only with true colors to mean mild user attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`. - Blue very sparingly only with true colors as `DiagnosticHint` and some additional important syntax group (like `Identifier`). - Magenta very carefully (if at all). ------ Notes - To make tests work without relatively larege updates, each one is prepended with an equivalent of the call `:colorscheme vim`. Plus some tests which spawn new Neovim instances also now use 'vim' color scheme. In some cases tests are updated to fit new default color scheme.
2023-10-03refactor(message): simplify msg_puts_display and use batched grid updatesbfredl1
msg_puts_display was more complex than necessary in nvim, as in nvim, it no longer talks directly with a terminal. In particular we don't need to scroll the grid before emiting the last char. The TUI already takes care of things like that, for terminals where it matters.
2023-07-23fix(events): trigger VimResume on next UI request (#24426)zeertzjq1
2023-06-04fix(ui): don't send empty grid_line with redrawdebug=compositor (#23899)zeertzjq1
2023-05-26fix(ui-ext): send title to newly-attached UIzeertzjq1
2023-05-21refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell1
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-05-10test: move most title tests to a separate file (#23557)zeertzjq1
This avoids running title tests twice unnecessarily.
2023-05-06fix(api): don't change title when setting buffer in a window (#23492)zeertzjq1
2023-02-13fix(ui): make sure screen is valid after resizingzeertzjq1
Problem: When not inside an Ex command, screen_resize() calls update_screen(), which calls screenclear() and set the screen as valid. However, when inside an Ex command, redrawing is postponed so update_screen() screen doesn't do anything, and the screen is still invalid after the resize, causing ui_comp_raw_line() to be no-op until update_screen() is called on the main loop. Solution: Restore the call to screenclear() inside screen_resize() so that the screen is invalid after screen_resize(). Since screenclear() changes redraw type from UPD_CLEAR to UPD_NOT_VALID, it is called at most once for each resize, so this shouldn't change how much code is run in the common (not inside an Ex command) case.
2022-11-22test: simplify platform detection (#21020)dundargoc1
Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`.
2022-10-22fix(ui): send grid_resize events before triggering VimResized (#20760)zeertzjq1
2022-10-12test: add a test for #20605zeertzjq1
2022-10-05feat(messages)!: graduate the 'msgsep' featurebfredl1
The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward.
2022-05-15refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque1
Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
2022-01-25fix: set RedrawingDisabled before entering aucmd_winzeertzjq1
2021-03-23screen: setup scrolling main screen when starting with display-=msgsepBjörn Linse1
2020-01-06vim-patch:8.1.1308: the Normal highlight is not defined when compiled with GUIJan Edmund Lazo1
Problem: The Normal highlight is not defined when compiled with GUI. Solution: Always define Normal. (Christian Brabandt, closes vim/vim#4072) https://github.com/vim/vim/commit/f90b6e03a983b62b66564fc449e32724d6456769
2019-09-26Fix two more flaky tests (#11095)Daniel Hahler1
* mode_spec: retry with increasing matchtime `matchtime=2` might still be too low (with luacov on AppVeyor). [ ERROR ] test/functional\ui\mode_spec.lua @ 47: ui mode_change event works in insert mode test\functional\ui\screen.lua:587: mode Expected objects to be the same. Passed in: (string) 'insert' Expected: (string) 'showmatch' Hint: full state of "mode": "insert" Followup to fe60013fb. ref #10941 Initially regressed in 7ed212262242 `` * ui/screen_basic_spec: set timeoutlen=10000 This fixes the test on slow CI. Ref: https://ci.appveyor.com/project/neovim/neovim/builds/27600387/job/t468h2b3w9lwtlm5#L10930
2019-02-05UI: always use contrete colors for default_colors_setBjörn Linse1
But add an escape hatch needed for external TUI, so it still can use terminal emulator defaults.
2018-12-05screen: add missing status redraw when redraw_later(CLEAR) was usedBjörn Linse1
2018-10-25UI: add missing redraw after enter_tabpageBjörn Linse1
redraw_all_later() isn't guaranteed to update must_redraw after switching tab, we must do it ourselves. fixes #9152
2018-10-15tests: improve robustness of immediate successes in screen testsBjörn Linse1
2018-10-01ui: rename ext_newgrid to ext_linegridBjörn Linse1
2018-07-24tests: add test for switching tabpage right after scrollBjörn Linse1
2018-07-24tests: test for redrawing tabline when msgsep marker goes outside screenBjörn Linse1
2018-07-21ui: use line-based rather than char-based updates in screen.cBjörn Linse1
Add ext_newgrid and ext_hlstate extensions. These use predefined highlights and line-segment based updates, for efficiency and simplicity.. The ext_hlstate extension in addition allows semantic identification of builtin and syntax highlights. Reimplement the old char-based updates in the remote UI layer, for compatibility. For the moment, this is still the default. The bulitin TUI uses the new line-based protocol. cmdline uses curwin cursor position when ext_cmdline is active.
2018-07-12screen: truncate showmode messagesBjörn Linse1
Before this, bottom of screen got messed up when modemsg (+ one extra space to not force terminal scroll) didn't fit on one line.
2018-05-04Merge pull request #8358 from mhinz/screenJames McCoy1
[RFC] screen: avoid artifacts
2018-05-04test: screen artifactsMarco Hinz1
2018-05-04messages: redraw tabline if it was overdrawn by messagesBjörn Linse1
fixes #8354 Regression from #8088, where we try to avoid clearing the screen if not absolutely necessary
2018-04-15events: VimSuspend, VimResume #8280geekodour1
closes #3648 ref #5959
2018-04-08test/API: validate channel arg (#8245)Justin M. Keyes1
2018-03-31msg: do not scroll entire screen (#8088)Björn Linse1
2018-02-23'fillchars': fix defaults logic; handle ambiwidth=double #7986Matthieu Coudron1
Update tests.