Instead of nested linked lists, store autocommands in a flat, contiguous
kvec_t, with one kvec_t per event type. Previously patterns were stored
in each node of the outer linked list, so they can be matched only once
on repeating patterns. They are now reference counted and referenced in
each autocommand, and matching is skipped if the pattern repeats. Speeds
up creation and deletion, execution is not affected.
Co-authored-by: ii14 <ii14@users.noreply.github.com>
Problem:
If shell-test finishes before the next RPC call, TermClose has already
been triggered, so the test fails.
Solution:
Add INTERACT argument so that shell-test keeps running.
Unlike split windows, creating a new floating window does not cause
other windows to resize, so it doesn't make much sense to trigger
WinScrolled or WinResized when creating a new floating window.
Problem: WinScrolled is not triggered when filler lines change.
Solution: Add "topfill" to the values that WinScrolled triggers on.
(closesvim/vim#11668)
3fc84dc2c7
Cherry-pick StopVimInTerminal() from patch 9.0.1010.
Problem: The WinScrolled autocommand event is not enough.
Solution: Add WinResized and provide information about what changed.
(closesvim/vim#11576)
35fc61cb5b
Omit "func_name" comment in tv_dict_extend(): Vim9 script only.
Skip layout locking and E1312.
Skip list_alloc_with_items() and list_set_item().
Since this overrides remaining changes in patch 9.0.0913, that patch can
now be marked as fully ported:
vim-patch:9.0.0913: only change in current window triggers the WinScrolled event
N/A patches for version.c:
vim-patch:9.0.0919: build failure with tiny features
Problem: Build failure with tiny features.
Solution: Adjust #ifdef's.
9c5b7cb4cf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Extend the capabilities of is_os to detect more platforms such as
freebsd and openbsd. Also remove `iswin()` helper function as it can be
replaced by `is_os("win")`.
Problem: WinScrolled may trigger immediately when defined.
Solution: Initialize the fields in all windows. (closesvim/vim#11582)
2996773276
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Only a change in the current window triggers the WinScrolled
event.
Solution: Trigger WinScrolled if any window scrolled or changed size.
(issue vim/vim#11576)
0a60f79fd0
Skip locking of window layout and E1312.
Copy the latest version of all WinScrolled tests from Vim.
Note: patch 9.0.0915 is needed for the Lua tests to pass.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This is essentially a convenience wrapper around the `pending()`
function, similar to `skip_fragile()` but more general-purpose.
Also remove `pending_win32` function as it can be replaced by
`skip(iswin())`.
fix(events): trigger WinScrolled when only skipcol changed
vim-patch:9.0.0304: WinScrolled is not triggered when only skipcol changes
Problem: WinScrolled is not triggered when only skipcol changes.
Solution: Add w_last_skipcol and use it. (closesvim/vim#10998)
670ab0334b
- Partially fixes#10386 except for the case where the alternate buffer
is the default, empty, first buffer created on startup. #vimlife
- TODO: port patches related to `can_unload_buffer`, maybe that fully
fixes#10386?
vim-patch:8.0.1732: crash when terminal API call deletes the buffer
Problem: Autocommand that splits window messes up window layout.
Solution: Disallow splitting a window while closing one. In ":all" give an
error when moving a window will not work.
1417c766f5
Expected error number was changed to E242 in Vim in patch 8.2.1183, and
patch 8.2.2420 (which has already been ported) made the test no longer
throw E249 in Vim, so just use E242 in the test.
Problem: Accessing freed memory after WinScrolled autocmd event.
Solution: Check the window pointer is still valid. (closesvim/vim#10156)
Remove the argument from may_trigger_winscrolled().
d58862d18f
Nvim uses a floating window for the autocmd window, but in certain situations,
it can be made non-floating (`:wincmd J`), which can cause issues due to the
previous setup and cleanup logic for a non-floating aucmd_win being removed from
aucmd_prepbuf and aucmd_restbuf.
This can cause glitchiness and crashes due to the aucmd_win's frame being
invalid after closing its tabpage, for example.
Ensure aucmd_win cannot be made non-floating. The only place this happens is in
win_split_ins if new_wp != NULL.
In Nvim, like DirChanged, this also triggers when switching windows.
This marks Vim patch 8.2.4335 as ported.
vim-patch:8.2.4335: no autocommand event triggered before changing directory
Problem: No autocommand event triggered before changing directory. (Ronnie
Magatti)
Solution: Add DirChangedPre. (closesvim/vim#9721)
28e8f73ae2
feat(eval): add reg_recorded()
This function is used the get the last recorded register.
style(Recording): rename handler to match suggestions
fix(RecordingLeave): send autocommand earlier
This makes the autocommand fire just before setting reg_recorded to
reg_recording, this way we clearly show that we are actually just before
actually quitting the recording mode.