aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
Commit message (Collapse)AuthorAge
* feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512LW2023-11-12
| | | | | | | | | | | | | | | | | | refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()` Problem: The LSP specification allows inlay hints to include tooltips, clickable label parts, and code actions; but Neovim provides no API to query for these. Solution: Add minimal viable extension point from which plugins can query for inlay hints in a range, in order to build functionality on top of. Possible Next Steps --- - Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
* test(ui/embed_spec): use notification instead of request (#25555)zeertzjq2023-10-09
| | | This avoid the hang mentioned in #24888, and also matches TUI better.
* fix(float): update position of anchored windows first (#25133)zeertzjq2023-09-14
|
* fix(ui): don't send empty grid_line with redrawdebug=compositor (#23899)zeertzjq2023-06-04
|
* fix(screen): redraw the ruler for a current floating windowbfredl2023-03-14
| | | | | | | Semi-regression. The "ruler" behavior for a floating window was never really specified but in practice followed the users cursor movements in normal mode in a focused float, which seems like a reasonable behavior to now specify.
* feat(ui): add scroll_delta to win_viewport event #19270Matthias Deiml2023-03-12
| | | | | | | | | | scroll_delta contains how much the top line of a window moved since the last time win_viewport was emitted. It is expected to be used to implement smooth scrolling. For this purpose it only counts "virtual" or "displayed" so folds should count as one line. Because of this it adds extra information that cannot be computed from the topline parameter. Fixes #19227
* test(ui): wait for another success with failure after successzeertzjq2023-03-01
| | | | | | | | | | | Problem: In a success-failure-success situation, if minimal timeout is reached between the failure and the second success, the session is stopped without waiting for the second success, causing the test to fail. Solution: Wait for another success if a failure is seen after a success. Ref #22155 #22464
* test: make {MATCH:} behave less unexpectedly in screen:expect()zeertzjq2023-02-18
| | | | Include the rest of the line and allow multiple {MATCH:} patterns.
* test: make expect_unchanged() less confusing (#22255)zeertzjq2023-02-15
| | | | | | | | Problem: The sleep before collecting the initial screen state is confusing and may lead to unexpected success if it comes after a blocking RPC call. Solution: Remove that sleep and add an "intermediate" argument.
* test: remove unused field ext_float (#22243)zeertzjq2023-02-14
|
* fix(tui): more work in the TUIbfredl2022-12-31
|
* fix(tests): only get the color map once, even for multiple test filesbfredl2022-11-27
| | | | | | | | | Problem: test/functional/ui/screen.lua would be reloaded for each *_spec.lua file, which causes an extra nvim session to be started to get the color map each time. solution: Mark screen.lua as a preloaded file, but defer the loading of the color map to the first time Screen object is initialised.
* docs: fix typos (#20394)dundargoc2022-09-30
| | | | | Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(cmdline): don't send invalid cursor with incsearch and cmdheight=0bfredl2022-09-26
| | | | fixes #20306
* feat(ui): allow to set the highlight namespace per windowbfredl2022-08-17
| | | | | - reimplement 'winhl' in terms of highlight namespaces - check for EOF in screen tests (to indicate a likely crash)
* fix(tui): resize at startup #17795Javier Lopez2022-07-04
| | | | | | | | | | | | | | | | | | * fix(test): screen.lua nil index When actual_rows and expected_rows are different avoid a nil index. * fix(tui): resize at startup The deleted code is not needed after 402b4e8. It caused the condition to false positive when the function was called more than once before startup (first normal mode). Being itself what set the dimension and not the user, locking the size of the screen to an incorrect size. Make got_winch an int to mitigate: tui_grid_resize changing the size of the host terminal between the signal handler and the call to sigwinch_cb. Since the actual signal handler uv__signal_handle doesn't directly call the callback, the event loop does. Fixes #17285 Fixes #15044 Fixes #11330
* refactor(highlight)!: rename attributes to match Vim (#19159)zeertzjq2022-06-30
| | | | | | | | | Ref: https://github.com/vim/vim/commit/84f546363068e4ddfe14a8a2a2322bb8d3a25417 Rename: - `underlineline` to `underdouble` - `underdot` to `underdotted` - `underdash` to `underdashed` `underdouble` also now takes higher precedence than `undercurl`.
* feat(ui): clear message history explicitly with msg_history_clear eventdevbhan singh2022-05-21
|
* Merge pull request #15674 from yatli/ui_event_extmarkbfredl2022-05-03
|\ | | | | API/UI: ui_event_extmark
| * feat(api/ui): win_extmarksYatao Li2022-05-03
| |
* | feat(server): set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009Justin M. Keyes2022-05-03
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM ------------------------------------------------------------------------ $NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the current process should listen on this address") and a descriptor ("the current process is a child of this address"). This contradiction means the presence of NVIM_LISTEN_ADDRESS is ambiguous, so child Nvim always tries to listen on its _parent's_ socket. This is the cause of lots of "Failed to start server" spam in our test/CI logs: WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0 WARN 2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0 SOLUTION ------------------------------------------------------------------------ 1. Set $NVIM to the parent v:servername, *only* in child processes. - Now the correct way to detect a "parent" Nvim is to check for $NVIM. 2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes. 3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after server init. 4. Open a channel to parent automatically, expose it as v:parent. Fixes #3118 Fixes #6764 Fixes #9336 Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696 Ref #8696
* docs: typo fixes (#17859)dundargoc2022-04-15
| | | | | | | | | | Co-authored-by: Elias Alves Moura <eliamoura.alves@gmail.com> Co-authored-by: venkatesh <shariharanvenkatesh@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Vikas Raj <24727447+numToStr@users.noreply.github.com> Co-authored-by: Steve Vermeulen <sfvermeulen@gmail.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: rwxd <rwxd@pm.me> Co-authored-by: casswedson <58050969+casswedson@users.noreply.github.com>
* feat(tui): add support for `CSI 4 : [2,4,5] m`Kirill Chibisov2022-03-03
| | | | | | | | This commit finishes support for colored and styled underlines adding `CSI 4 : [2,4,5] m` support providing double, dashed, and dotted underlines Fixes #17362.
* test: mention poke_eventloop() instead of wait()zeertzjq2022-03-02
|
* feat(api): win_viewport also sends line_count #15613Yatao Li2021-09-10
|
* floats: z-indexBjörn Linse2021-05-15
|
* ui: make 'mouse' handling in external UI more consistentBjörn Linse2021-01-01
| | | | | | | | | before the behaviour of 'mouse' was inconsistent in external UI, as some remapping logic would check has_mouse() and others don't (no difference in TUI or vim classic). With this change, the behaviour is consistently up to the UI decide (see ui.txt edit) Behaviour of tui.c is unaffected by this change.
* api: add API for themesBjörn Linse2020-11-01
| | | | | | | | | | co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function) orange is sus?? NOVEMBER DAWN erase the lie that is redraw_later()
* api/ui: win_viewport event for visible range and cursor position in windowBjörn Linse2020-04-01
|
* screen.lua: remove screen:_on_event #11488Justin M. Keyes2019-12-01
| | | Tests can redefine the handlers, so we don't need this extra hook.
* test/Screen:expect: replace "{IGNORE}" with "{MATCH:…}"Justin M. Keyes2019-11-09
| | | | ref #11004
* tests: Screen:expect: support "{MATCH:…}"Daniel Hahler2019-11-09
|
* terminal: add tests for palette color forwardingBjörn Linse2019-11-03
|
* test/screen: make snapshot_util() work properly in rgb_cterm modeBjörn Linse2019-11-02
|
* test/functional: retry/Screen: failure instead of error #11173Daniel Hahler2019-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Running out of retries, or unexpected screen state should make the test FAIL, not ERROR. - Uses levels to report the location of the caller. - Improve message with retry-failure (formatting). Before: [ RUN ] test: 103.53 ms ERR test/functional/helpers.lua:388: retry() attempts: 1 test/functional/ui/screen.lua:587: Row 1 did not match. Expected: |*X^ | |{0:~ }| |{0:~ }| | | Actual: |*^ | |{0:~ }| |{0:~ }| | | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/helpers.lua:388: in function 'retry' test/functional/test_spec.lua:24: in function <test/functional/test_spec.lua:23> After: [ RUN ] test: 105.22 ms FAIL test/functional/test_spec.lua:24: stopping after 1 retry() attempts. test/functional/test_spec.lua:25: Row 1 did not match. Expected: |*X^ | |{0:~ }| |{0:~ }| | | Actual: |*^ | |{0:~ }| |{0:~ }| | | To print the expect() call that would assert the current screen state, use screen:snapshot_util(). In case of non-deterministic failures, use screen:redraw_debug() to show all intermediate screen states. stack traceback: test/functional/helpers.lua:389: in function 'retry' test/functional/test_spec.lua:24: in function <test/functional/test_spec.lua:23>
* tests/ui: completely delete "attr_ignore" featureBjörn Linse2019-10-13
| | | | | All existing usages are ad-hoc/random/lazyness. Generating attribute specifications is not hard since four years, just do it always.
* tests/ui: cleanup illegitimate usages of "attr_ignore"Björn Linse2019-10-13
| | | | | "attr_ignore" is an anti-pattern, with snapshot_util() just include all the highlights already.
* tests/ui: make screen.lua use "linegrid" representation internallyBjörn Linse2019-10-13
| | | | | | | | | | PR #8221 took a short-cut when implementing the tests: screen.lua would translate the linegrid highlight ids back into the old per-cell attribute description. Apart from cleaning up technical debt, this enables to check both rgb and cterm colors in the same expect(), which previously was needlessly restricted to ext_hlstate tests only.
* syntax, TUI: support "strikethrough"Jaskaran Singh2019-09-13
| | | | | | fix #3436 Includes: vim-patch:8.0.1038: strike-through text not supported
* test: properly test missing clears after scrollBjörn Linse2019-09-06
| | | | | NB: happened to be irrelevant to the present failure, which only occured with the compositor and not exteral UI for some reason
* screen.lua: dump payload on handler failureJustin M. Keyes2019-09-01
| | | | | | | | | | | | For debugging failures like: test/functional/helpers.lua:240: test/functional/ui/screen.lua:898: bad argument #1 to 'unpack' (table expected, got number) test/functional/helpers.lua:240: test/functional/ui/screen.lua:708: attempt to index local 'item' (a number value) ref #10804
* test/ui: update tests for new msg_grid implementationBjörn Linse2019-09-01
|
* test/ui: make screen:expect() print full state when height does not matchBjörn Linse2019-09-01
|
* tests: screen: notification_cb: improve assertion messageDaniel Hahler2019-08-20
|
* ui: transmit "blend=" property of highlight attributesBjörn Linse2019-08-18
|
* test/ui: properly test win_hide by explicitly marking hidden gridsBjörn Linse2019-08-17
|
* ui: use Window type in win_pos consistently with win_float_posBjörn Linse2019-08-17
| | | | Also check invalid positional arguments to screen:expect()
* tests: fix/improve Screen:expect_unchanged (#10577)Daniel Hahler2019-07-24
| | | | | | Do not sleep before collecting initial state. Ref: https://github.com/neovim/neovim/pull/10550#issuecomment-513670205
* screen.lua: always print keyword-args snapshotJustin M. Keyes2019-07-20
|
* screen.lua: expect_unchanged(), get_snapshot()Justin M. Keyes2019-07-20
| | | | | | | | | | | | | | Factor `get_snapshot()` out of `print_snapshot()`, so that callers can get a table (for use with `expect()`) instead of the string form. Try to use this to fix indeterminism in `searchhl_spec.lua`. - Since the screen state is collected by `screen:expect_unchanged()`, we don't need a deterministic initial state (which would then be hardcoded into the test). This allows us to check "did anything change in the last N ms?" rather than "did anything change compared to a hardcoded screen-state?" - This may end up fruitless, because `expect_unchanged()` depends on timing to wait for an initial "current state".