Allow a "*count" suffix in a screen line to repeat the screen line for
"count" times.
The change is made to Screen:expect() and Screen:get_snapshot() instead
of Screen:render() so that screen expectations generated using code can
still work and test failures can still be readable.
A snapshot is now also printed on failure so that there is no need to
run the test again with Screen:snapshot_util().
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
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.
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
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
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.
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.
* 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#17285Fixes#15044Fixes#11330
Ref: 84f5463630
Rename:
- `underlineline` to `underdouble`
- `underdot` to `underdotted`
- `underdash` to `underdashed`
`underdouble` also now takes higher precedence than `undercurl`.
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#3118Fixes#6764Fixes#9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696
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.
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.
- 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>
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.
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