Problem: 'buftype' values not sufficiently tested.
Solution: Add and extend tests with 'buftype' values. (closesvim/vim#10988)
93f72cc119
"terminal" and "popup" buffer types cannot be tested, and commenting
them out causes an error, so just remove them.
Problem: BufReadCmd not triggered when loading a "nofile" buffer. (Maxim
Kim)
Solution: Call readfile() but bail out before reading a file.
(closesvim/vim#10983)
b1d2c8116c
Problem: Several errors are not tested for.
Solution: Add tests. (Yegappan Lakshmanan, closesvim/vim#5892)
ee4e0c1e9a
Omit Test_range() change: reverted in patch 8.2.0615.
Cherry-pick Test_z_no_space_before_xxx() from patch 8.2.0195.
Cherry-pick Test_reverse_sort_uniq() change from patch 8.2.0183.
Make uniq() error behavior consistent with sort().
Cherry-pick Test_set_ttytype() change from patch 8.1.1826.
Cherry-pick quickfix checks from patch 8.1.2373 to test_preview.vim.
Test_viminfo_error() is applicable.
Cherry-pick E1058 from patch 8.2.0149 and port Test_deep_nest() to Lua.
Problem: Insufficient testing for reading/writing files.
Solution: Add more tests. (Yegappan Lakshmanan, closesvim/vim#6257)
Add "ui_delay" to test_override() and use it for the CTRL-O test.
b340baed9f
Omit test_override().
Reorder test_writefile.vim to match Vim.
Problem: Cursor restored unexpected with nested autocommand.
Solution: Do not restore the cursor when it was moved intentionally.
(closesvim/vim#10780)
3d6ee8bda0
Problem: When switching window in autocmd the restored cursor position may
be wrong.
Solution: Do not restore the cursor if it was not set. (closesvim/vim#10775)
b03950fafa
This patch cannot be fully ported because it depends on patch 8.2.3518.
Problem: ModeChanged event not triggered when leaving the cmdline window.
Solution: Call may_trigger_modechanged(). (closesvim/vim#10791)
c9e8fd6fc7
Code is already present in Nvim. Add some other related missing changes.
- 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: DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution: Free the memory later. (closesvim/vim#10555)
d8c9d32c89
Code change is N/A as Nvim gets the full current directory again before
applying the autocommand, so this just ports the tests.
Problem: Test is not cleaned up.
Solution: Make test clean up after itself. Avoid NUL. (closesvim/vim#10233)
7851c69a12
Adapt test_autocmd_vimgrep() to Nvim.
Problem: Autocmd events triggered in different order when reusing an empty
buffer.
Solution: Call buff_freeall() earlier. (Charlie Groves, closesvim/vim#10198)
fef4485ef5
Test failure becomes very strange.
Problem: Using freed memory when using an autocommand to split a window
while a buffer is being closed.
Solution: Disallow splitting when the buffer has b_locked_split set.
983d83ff1c
Put the error message in window.c.
Cherry-pick a memory leak fix from Vim patch 8.2.0399.
Test still fails.
Problem: Using freed memory when window is closed by autocommand.
(houyunsong)
Solution: Check the window pointer is still valid.
2c7080bf1c
Add missing comment from Vim patch 8.0.1420.
Test fails.
Problem: Crash when using command line window in an autocommand.
(houyunsong)
Solution: Save and restore au_new_curbuf.
aad5f9d79a
Nvim has removed :open, so use :edit in the test instead.
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
Problem: Plugins cannot track text scrolling.
Solution: Add the WinScrolled event. (closesvim/vim#10102)
0937182d49
Skip User event in autocmd.txt, not needed unless #10689 is reverted.
Problem: Buffer remains active if a WinClosed event throws an exception
when there are multiple tabpages.
Solution: Ignore aborting() when closing the buffer. (closesvim/vim#10101)
6a06940f8a
Problem: Buffer remains active if a WinClosed event throws an exception.
Solution: Ignore aborting() when closing the buffer. (closesvim/vim#10097)
c947b9ae41
Problem: Crash when switching window in BufWipeout autocommand.
Solution: Put any buffer in the window to avoid it being NULL.
(closesvim/vim#10024)
347538fad0
win_init_empty() cannot be made static because it is used in autocmd.c
Problem: Autocmd not executed when editing a directory ending in a path
separator inside try block.
Solution: Return NOTDONE instead of FAIL. (closesvim/vim#8885)
40fa12aea3
Problem: <amatch> is expanded like a file name for DirChangedPre.
Solution: Do not expand <amatch>. (closesvim/vim#9742) Also for the User event.
f6246f51e3
Problem: Inconsistently using GetVimCommand() and v:progpath. (Daniel
Hahler)
Solution: Use GetVimCommand(). (closesvim/vim#4806)
93344c2d70
Cherry-pick a change to test_profile.vim from patch 8.1.1544.
Cherry-pick a change to test_vimscript.vim from patch 8.1.1826.
Some of the args are no-op in Nvim, and `-i NONE` and `--headless` are
already added by `GetVimCommand()`. I'll try to match the order of args
in upstream, substituting `--not-a-term` with `--headless`.
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
Problem: Test files still use function!.
Solution: Remove the exclamation mark. Fix overwriting a function.
1e1153600c
Some of the changes were already applied previously.
Problem: ml_get error with :doautoall and Visual area. (Sean Dewar)
Solution: Disable Visual mode while executing autocommands.
cb1956d6f2
This should also fix#16937 for nvim_buf_call, so test for it.
Problem: :lockmarks does not work for '[ and '].
Solution: save and restore '[ and '] marks. (James McCoy, closesvim/vim#5222)
f4a1d1c054
Test_diff_maintains_change_mark doesn't actually fail without these changes.
This is fixed in v8.2.3936.
We should now be equal with Vim in regards to method call support of already ported built-ins.
Enable all relevant commented-out uses of the syntax in tests that I could grep.
Problem: Using freed memory in :psearch. (houyunsong)
Solution: Check the current window is still valid. Fix flaky test.
92bb83e41c
Test_cursorhold_insert timer's 100ms delay was already LoadAdjusted, but change
to 200ms (still LoadAdjust) to match Vim anyway.
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closesvim/vim#5041)
ec66c41d84
Nvim doesn't use Vim's terminal implementation.
Despite this, Nvim has its own *exclusive* way of crashing here.
Requires 'winwidth' > winwidth() and 'nowinfixwidth' to crash; adjust
the test ('nowfw' is the default, but ensure its disabled anyway).
Problem: An OptionSet autocommand does not get enough info.
Solution: Add v:option_command, v:option_oldlocal and v:option_oldglobal.
(Latrice Wilgus, closesvim/vim#4118)
d7c9687947
Problem: No event is triggered when closing a window.
Solution: Add the WinClosed event. (Naohiro Ono, closesvim/vim#9110)
23beefed73
Nvim has already implemented this feature, so this only changes tests
and docs.