aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cursor_spec.lua
Commit message (Collapse)AuthorAge
* feat(terminal)!: cursor shape and blink (#31562)Gregory Anders2024-12-17
| | | | | | | | | | | | | | | | | | | | | When a terminal application running inside the terminal emulator sets the cursor shape or blink status of the cursor, update the cursor in the parent terminal to match. This removes the "virtual cursor" that has been in use by the terminal emulator since the beginning. The original rationale for using the virtual cursor was to avoid having to support additional UI methods to change the cursor color for other (non-TUI) UIs, instead relying on the TermCursor and TermCursorNC highlight groups. The TermCursor highlight group is now used in the default 'guicursor' value, which has a new entry for Terminal mode. However, the TermCursorNC highlight group is no longer supported: since terminal windows now use the real cursor, when the window is not focused there is no cursor displayed in the window at all, so there is nothing to highlight. Users can still use the StatusLineTermNC highlight group to differentiate non-focused terminal windows. BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
* feat(ex_cmds): :sleep! hides the cursor while sleeping (#31493)zeertzjq2024-12-07
| | | | | | | | | | Problem: :sleep! not hiding the cursor is an arbitrary difference from Vim without obvious justification, and Vim's behavior isn't easily achievable in Nvim. Solution: Make :sleep! hide the cursor while sleeping. Ref: https://github.com/neovim/neovim/commit/6a01b3fcc361960e559db459e1524418bc76dd66 https://github.com/neovim/neovim/commit/b5c0ade43790cf18f6a54858ddad30d8d9667cf9
* 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.
* vim-patch:9.1.0476: Cannot see matched text in popup menuzeertzjq2024-06-15
| | | | | | | | | | | | Problem: Cannot see matched text in popup menu Solution: Introduce 2 new highlighting groups: PmenuMatch and PmenuMatchSel (glepnir) closes: vim/vim#14694 https://github.com/vim/vim/commit/40c1c3317d92f8c2adadf744fab72e4458e2a9fa Co-authored-by: glepnir <glephunter@gmail.com>
* feat(highlight): add StatusLineTerm and StatusLineTermNC groupsGregory Anders2024-06-12
| | | | | | | These highlight groups are used for the statusline in :terminal windows. By default they link to StatusLine and StatusLineNC (respectively), so there is no visual difference unless a colorscheme defines these groups separately.
* 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): 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)
* fix(colorscheme): use explicit normal foreground in syntax groupsEvgeni Chasnovski2024-01-25
| | | | | | | | | | | | Problem: Some core syntax highlight groups are cleared with intention to always be shown without additional highlighting. This doesn't always work as intended, especially with fallback mechanism of @-groups. Example: `Statement`/`Keyword` group shown in help code blocks (`@markup.raw`) is shown as bold (from `Statement`) cyan (from `@markup.raw`) instead of bold grey. Solution: Explicitly use normal grey foreground in syntax groups where it was previously implicitly assumed.
* 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
|
* feat(highlight): tweak default color schemeEvgeni Chasnovski2023-12-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Updating default color scheme produced some feedback. Solution: Address the feedback. Outline of the changes: - Colors `Grey1` and `Grey2` are made a little bit more extreme (dark - darker, light - lighter) to increase overall contrast. - `gui` colors are treated as base with `cterm` colors falling back to using 0-15 colors which come from terminal emulator. - Update highlight group definition to not include attribute definition if it is intended to staty uncolored. - Tweak some specific highlight groups. - Add a list of Neovim specific highlight groups which are now defined differently in a breaking way. - Minor tweaks in several other places related to default color scheme.
* 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
* 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.
* fix(highlight): add `FloatFooter` to 'highlight_defs.h' (#25577)Evgeni Chasnovski2023-10-10
|
* 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:9.0.1397: highlight for popupmenu kind and extra cannot be set ↵zeertzjq2023-03-11
| | | | | | | | | | | (#22619) Problem: Highlight for popupmenu kind and extra cannot be set. Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel highlight groups and use them. (Gianmaria Bajo, closes vim/vim#12114) https://github.com/vim/vim/commit/6a7c7749204b256e779c245b1e999bf852ad7b64 Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
* feat(ui): add support to display a title in the border of a float (#20184)Raphael2022-11-06
| | | add "title" and "title_pos" keys to win config dict.
* perf(ui): eliminate spurious memory allocations for hl_attr_define eventbfredl2022-07-18
|
* fix(highlight): let winhighlight use cursorzbirenbaum2022-06-07
|
* feat(ui): add `'winbar'`Famiu Haque2022-05-18
| | | | | | | Adds support for a bar at the top of each window, enabled through the `'winbar'` option. Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* feat(highlight): implement CurSearch highlightFamiu Haque2022-04-17
| | | | Adds a `CurSearch` highlight group to highlight the current search result under the cursor.
* feat: add support for global statuslineFamiu Haque2022-03-18
| | | | | | | | | | Ref: #9342 Adds the option to have a single global statusline for the current window at the bottom of the screen instead of a statusline at the bottom of every window. Enabled by setting `laststatus = 3`. Due to the fact that statuslines at the bottom of windows are removed when global statusline is enabled, horizontal separators are used instead to separate horizontal splits. The horizontal separator character is configurable through the`horiz` item in `'fillchars'`. Separator connector characters are also used to connect the horizontal and vertical separators together, which are also configurable through the `horizup`, `horizdown`, `vertleft`, `vertright` and `verthoriz` items in `fillchars`. The window separators are highlighted using the `WinSeparator` highlight group, which supersedes `VertSplit` and is linked to `VertSplit` by default in order to maintain backwards compatibility.
* vim-patch:8.2.3664: cannot adjust sign highlighting for 'cursorline'James McCoy2021-12-08
| | | | | | | Problem: Cannot adjust sign highlighting for 'cursorline'. Solution: Add CursorLineSign and CursorLineFold highlight groups. (Gregory Anders, closes vim/vim#9201) https://github.com/vim/vim/commit/e413ea04b716effb28eb49dbc98ad3f9f761545a
* vim-patch:8.1.2229: color number column above/below cursor #15409zeertzjq2021-08-27
| | | | | Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624) https://github.com/vim/vim/commit/efae76ab1a43d5a628d8c2fa4218ace6ba597f5d
* floats: add borders (MS-DOS MODE)Björn Linse2021-03-22
|
* UI: fix cursor not displayed after hiding and un-hiding #12811erw72020-09-12
| | | | | | | | | | | | | | | | | | | | | | - TUI: Fix a case where the cursor was not displayed after hiding the cursor and then setting it to be displayed again. - Change to reset everything before setting guicursor. fixes #12800 close #12811 Steps to reproduce: nvim -u NORC :set termguicolors :hi nCursor guifg=red guibg=red :hi iCursor guifg=green guibg=green :hi cCursor guifg=blue guibg=blue :set guicursor=n:block-nCursor,i:hor25-iCursor,c:ver25-cCursor :set guicursor-=c:ver25-cCursor Actual behaviour: Cursor is a blue vertical. Expected behaviour: Cursor should be the default color block.
* TUI: can make the cursor transparent #11519Matthieu Coudron2019-12-19
| | | when setting 'guicursor' highlight blend=100.
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
* test/ui: update tests for new msg_grid implementationBjörn Linse2019-09-01
|
* ui: add 'redrawdebug' option for flexible debugging of redrawingBjörn Linse2019-07-09
|
* floats: add NormalFloat highlight and 'nonumber' defaultBjörn Linse2019-03-12
|
* tests: introduce screen:expect{...} formBjörn Linse2018-08-27
|
* cursor_shape: use attribute ids instead of syntax idsBjörn Linse2018-08-13
| | | | | As attribute ids is the convention in the UI protocol Also remove non-threadsafe calls in tui.c to syntax module.
* msg: do not scroll entire screen (#8088)Björn Linse2018-03-31
|
* options: make 'highlight' read-onlyBjörn Linse2017-05-15
|
* options: allow different highlights in windowsBjörn Linse2017-05-08
|
* 'guicursor': No color/blink by defaultJustin M. Keyes2017-04-30
| | | | Closes #6577
* ui: use an array for mode stylesBjörn Linse2017-04-21
|
* ui: add tests for new cursor shape modesBjörn Linse2017-04-21
|
* tests: short form `screen:except(func)` expects condition only. #6440Björn Linse2017-04-06
| | | | | | - Use this to properly test cursor shape events. - tests: update screen_basic_spec to use `screen:expect` short form. Clearer than using `screen:wait` directy.
* 'guicursor': Disable by default for unknown terminals.Justin M. Keyes2017-04-04
| | | | | | | User can still set guicursor explicitly in init.vim. Closes #5990 Closes #6403
* 'guicursor': enabled=false if 'guicursor' is emptyJustin M. Keyes2017-04-04
| | | | | Closes #6429 Closes #6430
* 'listchars': `Whitespace` highlight group #6367Yichao Zhou2017-04-03
|
* tests: Fix testlint errorsZyX2017-04-03
|
* api/cursor_style_set: mode descriptionsJustin M. Keyes2017-04-01
|
* 'guicursor': Empty means "block cursor in all modes".Justin M. Keyes2017-04-01
Also: update default 'guicursor' to match the documentation.