* 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 7ed2122622
``
* 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
Previously, the "precedes" character would be rendered on every row
when w_skipcol > 0 (i.e., when viewing a single line longer than the
entire screen), instead of just on the first row. Make sure to only
render it on the first row in this case.
Add a test for this behavior.
Fix documentation for the "precedes" character, which erroneously
stated that it was only active when wrap mode was off.
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
expected.
* test/wildmode_spec: fix flaky test
a00eb23c27 fixed one race, but not this one:
[ ERROR ] test/functional/ui/wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
test/functional/ui/screen.lua:587: Row 1 did not match.
Expected:
|* |
| |
| |
|define jump list > |
|:sign define^ |
Actual:
|*0: !terminal_output! |
| |
| |
|define jump list > |
|:sign define^ |
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/ui/screen.lua:587: in function '_wait'
test/functional/ui/screen.lua:370: in function 'expect'
test/functional/ui/wildmode_spec.lua:22: in function 'expect_stay_unchanged'
test/functional/ui/wildmode_spec.lua:92: in function <test/functional/ui/wildmode_spec.lua:84>
* fixup! test/wildmode_spec: fix flaky test
a00eb23c27 fixed one race, but not this one:
[ ERROR ] test/functional/ui/wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
test/functional/ui/screen.lua:587: Row 1 did not match.
Expected:
|* |
| |
| |
|define jump list > |
|:sign define^ |
Actual:
|*0: !terminal_output! |
| |
| |
|define jump list > |
|:sign define^ |
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/ui/screen.lua:587: in function '_wait'
test/functional/ui/screen.lua:370: in function 'expect'
test/functional/ui/wildmode_spec.lua:22: in function 'expect_stay_unchanged'
test/functional/ui/wildmode_spec.lua:92: in function <test/functional/ui/wildmode_spec.lua:84>
[ ERROR ] test/functional\ui\wildmode_spec.lua @ 84: 'wildmenu' is preserved during :terminal activity
test\functional\ui\screen.lua:587: Row 1 did not match.
Expected:
|*:sign |
|*define place |
|*jump undefine |
|*list unplace |
|*:sign ^ |
Actual:
|*0: !terminal |
|* |
|*^ |
|*~ |
|* |
stack traceback:
test\functional\ui\screen.lua:587: in function '_wait'
test\functional\ui\screen.lua:370: in function 'expect'
test/functional\ui\wildmode_spec.lua:22: in function 'expect_stay_unchanged'
test/functional\ui\wildmode_spec.lua:103: in function <test/functional\ui\wildmode_spec.lua:84>
Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the
message grid and remove it just afterwards. While inefficient, we must
make sure update_screen() re-validates the default_grid completely when
this happens.
Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not
used.
Elide a too early ui_flush() on startup, which caused an invalid cursor
position to be used.
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
REP_NODELAY was added because REP delayed too much. This changes REP to
only add a delay on every 100th line instead.
This helps to cover the additional pulse steps with
out_data_decide_throttle, which would have required to change
REP_NODELAY anyway.
Before this commit, when `inccomand` was set to `nosplit`, multi-line
substitutions collapsed the command-line.
This happened because when ex_getln.c:cursorcmd() computed a msg_row, it
was given a cmdline_row one line too high. This happened because
message.c:msg_puts_display() was supposed to decrement cmdline_row but
didn't, because of the `msg_no_more && lines_left == 0` check placed
just before the decrementation part in msg_puts_display's while loop.
Every time msg_puts_display writes a line, it decreases `lines_left` (a
variable used to know how many lines are left for prompts). Since
redrawcommandline() did not reset `lines_left` between calls to
msg_puts_display, every time a character was pressed, `lines_left` was
decremented. This meant that once the user pressed COLUMNS+ROWS numbers
of characters, `lines_left` would reach 0 and prevent msg_row from being
decremented.
It makes sense to fix setting `lines_left` to `cmdline_row` in
`compute_cmdrow` ; after all, computing where the command line row
should be placed is equivalent to computing how many `lines_left` of
output there are left.
Closes#8254.
(<Cmd>0<cr> is not really a no-op, it moves the cursor.)
Attempt to avoid flaky test:
test/functional/ui/cmdline_spec.lua @ 830
Failure message: ./test/functional/ui/screen.lua:579: Row 2 did not match.
Expected:
| |
|*{1:~ }|
|{3: }|
|:012345678901234567890123|
|456789^ |
Actual:
| |
|*{3: }|
|:012345678901234567890123|
|:012345678901234567890123|
|456789^ |
./test/functional/ui/screen.lua:579: in function '_wait'
./test/functional/ui/screen.lua:367: in function 'expect'
test/functional/ui/cmdline_spec.lua:841: in function <test/functional/ui/cmdline_spec.lua:830>
ref https://github.com/neovim/neovim/pull/10171#issuecomment-520134344
ref #10171
Fix flaky "shell command :! throttles shell-command output greater than ~10KB:":
[ RUN ] shell command :! throttles shell-command output greater than ~10KB:
warning: Screen changes were received after the expected state. This indicates
indeterminism in the test. Try adding screen:expect(...) (or wait()) between
asynchronous (feed(), nvim_input()) and synchronous API calls.
- Use screen:redraw_debug() to investigate; it may find relevant intermediate
states that should be added to the test to make it more robust.
- If the purpose of the test is to assert state after some user input sent
with feed(), adding screen:expect() before the feed() will help to ensure
the input is sent when Nvim is in a predictable state. This is preferable
to wait(), for being closer to real user interaction.
- wait() can trigger redraws and consequently generate more indeterminism.
Try removing wait().
ERR
test/functional/ui/screen.lua:579: Failed to match any screen lines.
Expected (anywhere): "
%."
Actual:
|XXXXXXXXXX 591 |
|XXXXXXXXXX 592 |
|XXXXXXXXXX 593 |
|XXXXXXXXXX 594 |
| |
| |
|{3:-- TERMINAL --} |
stack traceback:
test/functional/ui/screen.lua:579: in function '_wait'
test/functional/ui/screen.lua:367: in function 'expect'
test/functional/ui/output_spec.lua:63: in function <test/functional/ui/output_spec.lua:53>
Log: https://travis-ci.org/neovim/neovim/jobs/569082705#L5355
(gcc-functionaltest-lua)
Problem: When user tries to exit with CTRL-C message is confusing.
Solution: Only mention ":qa!" when there is a changed buffer. (closesvim/vim#4163)
a84a3dd663
vim-patch:8.1.1052: test for CTRL-C message sometimes fails
Problem: test for CTRL-C message sometimes fails
Solution: Make sure there are no changed buffers.
553e5a5c56
vim-patch:8.1.1053: warning for missing return statement
Problem: Warning for missing return statement. (Dominique Pelle)
Solution: Add return statement.
d6c3f1fa2b
Typically most shell output is the result of non-trivial work, so it
would not blast stdout instantaneously. To more closely simulate that
typical scenario, change `shell-test REP` to wait 1 millisecond between
iterations.
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".
The interaction between 'winblend' and doublewidth chars in the background
does not look very good. But check no chars get incorrectly placed
at least.
Also check that hidden EndOfBuffer region (from style="minimal") blends
correctly.
Note: test doesn't fail on master. I cannot reproduce the glitches with
-u NONE, probably it requires interfering events. But add some coverage
for these checks at least.
ext_message doesn't set msg_col. Add a space and let client deal with
wrapping. When using silent redirect show the unwrapped message form.
Removed check is already part of msg_advance()
* screen: Fix to draw signs with combining characters.
The buffer size for signs can be too small, because the upper length
limit of a sign can be 56 bytes. If combining characters are only two
bytes in size, this reduces to 32 bytes.
* screen: Adjust buffer size to maximal sign column count
Problem: Sign message not translated and inconsistent spacing.
Solution: Add _() for translation. Add a space. (Ken Takata) Also use
MSG_BUF_LEN instead of BUFSIZ.
d730c8e297
Problem: Placing signs can be complicated.
Solution: Add functions for defining and placing signs. Introduce a group
name to avoid different plugins using the same signs. (Yegappan
Lakshmanan, closesvim/vim#3652)
162b71479b
The test.functional.helpers and test.unit.helpers modules now include
all of the public functions from test.helpers, so there is no need to
separately require('test.helpers').
Previously, ordinary redraws were missing from terminal mode. Instead,
there was an async callback that invoked update_screen() on terminal
data regardless of mode (as if :redraw! was invoked by a timer).
This created some issues:
- async changes to an unrelated ordinary buffer were not always redrawn in
terminal mode
- screen cursor position was not properly updated in terminal mode (partial
fix, will be properly fixed in a follow up PR)
- ad-hoc logic was needed for interaction with special states such as
inccommand or horizontal wildmenu.
Instead redraw terminal mode just like any other state. This disables forced
redraws in cmdline mode, which were inconisent which async changes to
normal buffers (which are not redrawn in cmdline mode).
Callers can instead specify `args_rm={'--headless'}`.
TODO: should `nvim_argv` have "--headless" by default? Need to inspect
some uses of spawn(nvim_argv) ...
- Allow floating windows of width 1. #9846
- For a new floating window the size must be specified. Later on we
might try to calculate a reasonable size by buffer contents
- Remember the configured size of a window, just like its position.
- Make get_config and set_config more consistent. Handle relative='' properly in set_config.
get_config doesn't return keys that don't make sense for a non-floating window.
- Don't use width=0 for non-changed width, just omit the key.