aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen_basic_spec.lua
Commit message (Collapse)AuthorAge
* 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.
* fix(ui): clamp 'cmdheight' for other tabpages on screen resize (#31419)zeertzjq2024-12-02
|
* 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.
* fix(drawline): don't draw beyond end of window (#29035)zeertzjq2024-05-27
|
* 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.
* refactor(tests): use new global defaults instead of set_default_attr_idsbfredl2024-03-26
| | | | This will be done in batches.
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: typing for helpers.methsLewis Russell2024-01-12
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* refactor(options): remove side effects from `check_num_option_bounds()`Famiu Haque2023-12-24
|
* 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: 'nofsync' with deadly signal #26415Justin M. Keyes2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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; } }
* feat(highlight): update default color schemeEvgeni Chasnovski2023-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* refactor(message): simplify msg_puts_display and use batched grid updatesbfredl2023-10-03
| | | | | | | | | 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.
* fix(events): trigger VimResume on next UI request (#24426)zeertzjq2023-07-23
|
* fix(ui): don't send empty grid_line with redrawdebug=compositor (#23899)zeertzjq2023-06-04
|
* fix(ui-ext): send title to newly-attached UIzeertzjq2023-05-26
|
* 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>
* test: move most title tests to a separate file (#23557)zeertzjq2023-05-10
| | | This avoids running title tests twice unnecessarily.
* fix(api): don't change title when setting buffer in a window (#23492)zeertzjq2023-05-06
|
* fix(ui): make sure screen is valid after resizingzeertzjq2023-02-13
| | | | | | | | | | | | | | | | | 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.
* test: simplify platform detection (#21020)dundargoc2022-11-22
| | | | | 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")`.
* fix(ui): send grid_resize events before triggering VimResized (#20760)zeertzjq2022-10-22
|
* test: add a test for #20605zeertzjq2022-10-12
|
* feat(messages)!: graduate the 'msgsep' featurebfredl2022-10-05
| | | | | | | 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.
* refactor(ui)!: link `VertSplit` to `Normal` by defaultFamiu Haque2022-05-15
| | | | | Avoids using `gui=reverse` on `VertSplit` and makes window separators look much nicer by default.
* fix: set RedrawingDisabled before entering aucmd_winzeertzjq2022-01-25
|
* screen: setup scrolling main screen when starting with display-=msgsepBjörn Linse2021-03-23
|
* vim-patch:8.1.1308: the Normal highlight is not defined when compiled with GUIJan Edmund Lazo2020-01-06
| | | | | | 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
* Fix two more flaky tests (#11095)Daniel Hahler2019-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* UI: always use contrete colors for default_colors_setBjörn Linse2019-02-05
| | | | | But add an escape hatch needed for external TUI, so it still can use terminal emulator defaults.
* screen: add missing status redraw when redraw_later(CLEAR) was usedBjörn Linse2018-12-05
|
* UI: add missing redraw after enter_tabpageBjörn Linse2018-10-25
| | | | | | | redraw_all_later() isn't guaranteed to update must_redraw after switching tab, we must do it ourselves. fixes #9152
* tests: improve robustness of immediate successes in screen testsBjörn Linse2018-10-15
|
* ui: rename ext_newgrid to ext_linegridBjörn Linse2018-10-01
|
* tests: add test for switching tabpage right after scrollBjörn Linse2018-07-24
|
* tests: test for redrawing tabline when msgsep marker goes outside screenBjörn Linse2018-07-24
|
* ui: use line-based rather than char-based updates in screen.cBjörn Linse2018-07-21
| | | | | | | | | | | | | 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.
* screen: truncate showmode messagesBjörn Linse2018-07-12
| | | | | Before this, bottom of screen got messed up when modemsg (+ one extra space to not force terminal scroll) didn't fit on one line.
* Merge pull request #8358 from mhinz/screenJames McCoy2018-05-04
|\ | | | | [RFC] screen: avoid artifacts
| * test: screen artifactsMarco Hinz2018-05-04
| |
* | messages: redraw tabline if it was overdrawn by messagesBjörn Linse2018-05-04
|/ | | | | | | fixes #8354 Regression from #8088, where we try to avoid clearing the screen if not absolutely necessary
* events: VimSuspend, VimResume #8280geekodour2018-04-15
| | | | | closes #3648 ref #5959
* test/API: validate channel arg (#8245)Justin M. Keyes2018-04-08
|
* msg: do not scroll entire screen (#8088)Björn Linse2018-03-31
|
* 'fillchars': fix defaults logic; handle ambiwidth=double #7986Matthieu Coudron2018-02-23
| | | | Update tests.
* test: avoid extra clear() callsJustin M. Keyes2017-10-02
| | | | also: various other cleanup
* win: vim_FullName(): force backslashes #7287Ignas Anikevicius2017-10-02
| | | | | | | | | - Replace obvious cases of '/' literal with PATHSEP. (There are still some remaining cases that need closer inspection.) - Fixup tests: ui/screen_basic closes #7117 ref https://github.com/neovim/neovim/issues/2471#issuecomment-271193714