The overwhelming majority of use cases for `open_float` are to view
diagnostics from the current buffer in a floating window. Thus, most use
cases will just `0` or `nil` as the first argument, which makes the
argument effectively useless and wasteful.
In the cause of optimizing for the primary use case, make the `bufnr`
parameter an optional parameter in the options table. This still allows
using an alternative buffer for those that wish to do so, but makes the
"primary" use case much easier.
The old signature is preserved for backward compatibility, though it can
likely be fully deprecated at some point.
Fixes `q` in more pager, where `:highlight` can be quit out of with a
single `q` keystroke, while in `:lua print(vim.inspect(vim))` it just
scrolls down a page.
Read_file_list is used to read back data from the nvim log file as the
testsuite executes. However, the nvim log file can get really big
(each full run of the testsuite appends roughly 150MB of data to this
file). Reading each line of this file can thus be extremely slow, and so
are the repeated table.insert/table.removes that are done for each line.
A solution to this issue is tto only read the end of the file.
This results in a sizeable improvement in testsuite run times in some
cases, e.g. on my computer:
Without this commit:
real 20m0.431s
user 17m11.163s
sys 1m59.422s
With this commit:
real 4m25.356s
user 1m41.673s
sys 1m31.253s
nvim_buf_get_extmark uses "end_row" rather than "end_line" in its
'details' dict, which means callers must modify the key names if they
want to re-use the information. Change the parameter name in
nvim_buf_set_extmark to "end_row" and use "end_line" as an alias
to make this more consistent.
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: Cannot backspace in prompt buffer after using cursor-left. (Maxim
Kim)
Solution: Ignore "arrow_used" in a prompt buffer. (closesvim/vim#7281)
6f6244855f
cmdchar_todo wasn't adapted properly for Nvim's state system, which caused it to
be a dead store and such was removed in #11900.
Re-introduce cmdchar_todo properly.
Problem: Try-catch test fails.
Solution: Don't call win_enter(), only call enterering_window().
bdf931c25b
v8.2.1781 caused Test_reload_in_try_catch() from v8.2.0004 to fail in Vim, but
it has not been ported yet.
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: Typing CTRL-W in a prompt buffer shows mode "-- --".
Solution: Set restart_edit to 'A' and check for it.
942b4541a2
Nvim already checked for 'i' in showmode(), so this bug was fixed with <C-W>
(though this patch now changes <C-W> to use 'A').
However, the missing changes I ported for v8.1.0036 use 'A' when a callback
leaves the window in insert mode and edit gets restarted, so this bug was
possible there.
Modify showmode() restart_edit condition to match v8.2.1978:
957cf67d50
Problem: If omni completion opens a window Insert mode is stopped.
(Hirohito Higashi)
Solution: Only set stop_insert_mode in a prompt buffer window.
f98b845dd1
popupmenu_spec.lua fails without this.
Problem: Not easy to switch between prompt buffer and other windows.
Solution: Accept CTRL-W commands in Insert mode. Start and stop Insert mode
as one would expect.
6d41c78e35
Cherry-pick channel.txt change from:
d2f3a8b878
b_prompt_insert was already ported.