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.
Problem: CurSearch highlight is often wrong.
Solution: Remember the last highlighted position and redraw when needed.
368137aa52
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: both `StatusLineTerm`/`StatusLineTermNC` are now explicitly
used, but `:color vim` does not set them to the values used in Vim.
This might be fine if `:color vim` is treated as "the state of default
color scheme prior the big update", but it seems to be better treated
as "Vim's default color scheme" (how it is documented in its header).
Solution: add `StatusLineTerm`/`StatusLineTermNC` definitions to
'runtime/colors/vim.lua'.
Use explicit foreground colors ('Whte'/'Black') instead of `guifg=bg`
used in source, as the latter caused some problems in the past (if
`Normal` is not defined, `nvim_set_hl()` can't recognize `'bg'` as the
foreground value).
Also realign the rest of the background conditional highlight groups.
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.
Problem: Adding a character for incsearch fails at end of line.
Solution: Only check cursor line number.
d4566c14e7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
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
Problem: Peeking and flushing output slows down execution.
Solution: Do not update the mode message when global_busy is set. Do not
flush when only peeking for a character. (Ken Takata)
cb574f4154
Problem: Using freed memory when 'tagfunc' wipes out buffer that holds
'complete'.
Solution: Make a copy of the option. Make sure cursor position is valid.
0ff01835a4
Cherry-pick a cmdwin change from patch 9.0.0500.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Incsearch not triggered when pasting clipboard register on the
command line.
Solution: Also set "literally" when using a clipboard register. (Ken Takata,
closesvim/vim#12460)
9cf6ab1332
Co-authored-by: K.Takata <kentkt@csc.jp>
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:
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: Inserting a register on the command line does not trigger
incsearch or update hlsearch.
Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
and handle it correctly. (Ken Takata, closesvim/vim#11960)
c4b7dec382
Co-authored-by: K.Takata <kentkt@csc.jp>
Problem: Highlight of char beyond line end is not correct. (Chuan Wei Foo)
Solution: Fix counting NUL as one cell. Draw one more character if the EOL
is part of the match. (closesvim/vim#7883)
41f0895c6e
Reorder test_search.vim to match Vim.
Problem: CurSearch highlight does not work for multi-line match.
Solution: Check cursor position before adjusting columns. (closesvim/vim#10133)
693ccd1160
Problem: Current instance of last search pattern not easily spotted.
Solution: Add CurSearch highlighting. (closesvim/vim#10133)
a43993897a
This fixes CurSearch highlight for multiline match.
Omit screen redrawing code because Nvim redraws CurSearch differently.
Problem: Highlighting for :s wrong when using different separator.
Solution: Use separat argument for search direction and separator. (Rob
Pilling, closesvim/vim#5665)
c036e87bd7
Problem: Mode is not cleared when leaving Insert mode with mapped Esc.
Solution: Clear the mode when redraw_cmdline is set. (closesvim/vim#4269)
4c25bd785a
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".
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).
Problem: CTRL-G/CTRL-T don't work with incsearch and empty pattern.
Solution: Use the last search pattern. (Christian Brabandt, closesvim/vim#2292)
d048009717
Problem: Incremental search only shows one match.
Solution: When 'incsearch' and and 'hlsearch' are both set highlight all
matches. (haya14busa, closesvim/vim#2198)
2e51d9a097