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.
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.
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)
Problem: Modifying a hidden buffer still interferes with prompt buffer
mode changes.
Solution: Save and restore b_prompt_insert.
(zeertzjq)
closes: vim/vim#13875
Modifying hidden buffer still interferes with prompt buffer mode changes
f267847017
Problem: Insert mode not stopped if an autocommand modifies a hidden
buffer while closing a prompt buffer.
Solution: Don't set b_prompt_insert if stop_insert_mode is already set.
(zeertzjq)
closes: vim/vim#1387296958366ad
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: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closesvim/vim#12237)
05a627c3d4
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Restarting Insert mode in prompt buffer too often when a callback
switches windows and comes back. (Sean Dewar)
Solution: Do not set "restart_edit" when already in Insert mode.
34c20ff85b
As Test_prompt_switch_windows is skipped, implement it in prompt_buffer_spec.
Replace the 50ms term_wait calls with poke_eventloop (test seems to work anyway
without them, so maybe they're not required?)
The new test does include a duplicate screen test that may generate a "screen
test succeeded immediately" warning, but this is done to match the Vim test.
I already ported v8.1.1984 previously, but hadn't updated prompt_buffer_spec to
match test_prompt_buffer (which we have but due to Vim features such as
term_sendkeys it's mostly skipped).
Required for v8.2.3671.
Problem: Using CTRL-O in a prompt buffer moves cursor to start of the line.
Solution: Do not move the cursor when restarting edit. (closesvim/vim#7330)
ee8b787bcd
Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.
Problem: Writing to prompt buffer interferes with insert mode.
Solution: Use win_enter() instead of just setting "curwin". (Ben Jackson,
closesvim/vim#7035)
4537bcc889
Vim test will be skipped, so add a Lua test.
The problem boils down to the use of aucmd_restbuf in a callback, so just test
that (via nvim_buf_set_lines).
Problem: Not restoring Insert mode if leaving a prompt buffer by using a
mouse click.
Solution: Set b_prompt_insert appropriately. Also correct cursor position
when moving cursor to last line.
891e1fd894
Problem: BS in prompt buffer starts new line.
Solution: Do not allows BS over the prompt. Make term_sendkeys() handle
special keys. Add a test.
6b810d92a9