Age | Commit message (Collapse) | Author |
|
Problem: Autocommand may change currect directory after :tcd and :lcd.
Solution: Also clear tp_localdir and w_localdir when using aucmd_win.
(zeertzjq)
closes: #14435
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Test for TextChanged is still flaky with ASAN.
Solution: Don't index the result of readfile().
(zeertzjq)
It turns out that with ASAN the file may become empty during a write
even if it's non-empty both before and after the write, in which case
indexing the result of readfile() will error, so use join() instead.
Also don't delete the file halfway the test, just in case it may cause
errors on the next read.
closes: #14421
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Test for TextChanged is flaky with ASAN.
Solution: Wait for the file to be non-empty.
(zeertzjq)
closes: #14404
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Normal mode TextChanged isn't tested properly.
Solution: Combine Test_Changed_ChangedI() and Test_Changed_ChangedI_2()
and also run it on Windows. Fix a typo in main.c.
(zeertzjq)
closes: #14396
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Filetype test fails.
Solution: Move detection by name before detection by extension.
Improve TextChanged test and remove wrong test and fix
a typo in a comment (zeertzjq).
closes: #14373
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Filetype may be undetected when a SwapExists autocommand sets
filetype in another buffer.
Solution: Make filetype detection state buffer-specific. Also fix a
similar problem for 'modified' (zeertzjq).
closes: #14344
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: TextChanged autocommand not triggered under some circumstances
(Sergey Vlasov)
Solution: Trigger TextChanged when TextChangedI has not been triggered
fixes: #14332
closes: #14339
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: No autocommand when writing session file
Solution: Add SessionWritePost autocommand
(Colin Kennedy)
fixes: ##14242
closes: #14288
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Colin Kennedy <colinvfx@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: Crash in WinClosed after BufUnload closes other windows
Solution: Don't trigger WinClosed if the buffer is NULL (zeertzjq)
Now win_close_othertab() doesn't trigger any autocommands if the buffer
is NULL, so remove the autocmd blocking above (which was added not long
ago in patch v9.0.0550) for consistency.
Also remove an unreachable close_last_window_tabpage() above:
- It is only reached if only_one_window() returns TRUE and last_window()
returns FALSE.
- If only_one_window() returns TRUE, there is only one tabpage.
- If there is only one tabpage and last_window() returns FALSE, the
one_window() in last_window() must return FALSE, and the ONE_WINDOW
in close_last_window_tabpage() must also be FALSE.
- So close_last_window_tabpage() doesn't do anything and returns FALSE.
Then the curtab != prev_curtab check also doesn't make much sense, and
the only_one_window() can be replaced with a check for popup and a call
to last_window() since this is a stricter check than only_one_window().
closes: #14166
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: [security]: autocmd cause use-after-free in set_curbuf()
(kawarimidoll)
Solution: check side-effect of BufLeave autocommand, when the number
of windows changed, close windows containing buffers that will
be wiped, if curbuf changed unexpectedly make sure b_nwindows
is decremented otherwise it cannot be wiped
set_curbuf() already makes some efforts to ensure the BufLeave
autocommands do not cause issues. However there are still 2 issues
that are not taken care of:
1) If a BufLeave autocommand opens a new window containing the same
buffer as that is going got be closed in close_buffer() a bit later,
we suddenly have another window open, containing a free'd buffer. So we
must check if the number of windows changed and if it does (and the
current buffer is going to be wiped (according to the 'bufhidden'
setting), let's immediately close all windows containing the current
buffer using close_windows()
2) If a BufLeave autocommand changes our current buffer (displays it in
the current window), buf->b_nwindow will be incremented. As part of
set_curbuf() we will however enter another buffer soon, which means, the
newly created curbuf will have b_nwindows still have set, even so the
buffer is no longer displayed in a window. This causes later problems,
because it will no longer be possible to wipe such a buffer. So just
before entering the final buffer, check if the curbuf changed when
calling the BufLeave autocommand and if it does (and curbuf is still
valid), decrement curbuf->b_nwindows.
Both issues can be verified using the provided test (however the second
issue only because such an impacted buffer won't be wiped, causing
futher issues in later tests).
fixes: #13839
closes: #14104
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: When the quickfix buffer has been modified an autocommand
may invalidate the undo stack (kawarimidoll)
Solution: When clearing the quickfix buffer, also wipe the undo stack
fixes: #13905
closes: #13928
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: TextChanged not triggered for :norm! commands
(machakann, after v9.0.2031)
Solution: Only reset curbuf->b_last_changedtick if TextChangedI
was triggered in insert mode (and not blocked)
Note: for unknown reasons, the test fails on Windows (but seems to work
fine when running interactively)
fixes: #13967
closes: #13984
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: No event is triggered before creating a window.
(Sergey Vlasov)
Solution: Add the WinNewPre event (Sergey Vlasov)
fixes: #10635
closes: #12761
Signed-off-by: Sergey Vlasov <sergey@vlasov.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: No test for mode() when executing Ex commands
Solution: Add some test cases and simplify several other test cases.
Also add a few more test cases for ModeChanged.
closes: #13588
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: TextChangedI may not always trigger
Solution: trigger it in more cases: for insert/
append/change operations, and when
opening a new line,
fixes: #13367
closes: #13375
Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
|
|
Problem: `TextChangedI` can trigger on entering Insert mode if there
was previously a change not in Insert mode.
Solution: Make it trigger only when text is actually changed in Insert
mode.
closes: #13265
closes: #13338
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
|
|
Problem: :bwipe fails after switching window from aucmd_win.
Solution: Decrement b_nwindows after switching back to aucmd_win.
closes: #13160
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
Problem: Various Typos
Solution: Fix Typos
This is a collection of typo related commits.
closes: #12753
closes: #13016
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: The ModeChanged event may be triggered too often.
Solution: Only trigger ModeChanged when no operator is pending.
(closes #12298)
|
|
Problem: Shortmess test depends on order of test execution.
Solution: Clear messages. (closes #12264)
|
|
Problem: Change for triggering incsearch not sufficiently tested.
Solution: Add a test case. Simplify the code. (closes #11971)
|
|
Problem: CTRL-N and -P on cmdline don't trigger CmdlineChanged.
Solution: Jump to cmdline_changed instead of cmdline_not_changed.
(closes #11956)
|
|
Problem: Code style is not check in test scripts.
Solution: Add basic code style check for test files.
|
|
Problem: File left behind after running tests.
Solution: Delete the file. (Dominique Pellé, closes #11839)
|
|
Problem: Sporadic test failures when using a terminal window.
Solution: Adjust waiting times. (James McCoy, closes #11763)
|
|
Problem: Autocommand test sometimes fails.
Solution: Add a short delay. (James McCoy, closes #11737)
|
|
Problem: Code for making 'shortmess' temporarily empty is repeated.
Solution: Add functions for making 'shortmess' empty and restoring it.
(Christian Brabandt, closes #11709)
|
|
Problem: Using a <Cmd> mapping CmdlineChanged may be triggered twice.
Solution: Count the number of times CmdlineChanged is triggered and avoid
doing it twice. (closes #116820
|
|
Problem: WinScrolled is not triggered when filler lines change.
Solution: Add "topfill" to the values that WinScrolled triggers on.
(closes #11668)
|
|
Problem: Stray warnings for existing swap files.
Solution: Wipe out the buffer until it has no name and no swap file.
|
|
Problem: Using one window for executing autocommands is insufficient.
Solution: Use up to five windows for executing autocommands.
|
|
Problem: Crash when unletting a variable while listing variables.
Solution: Disallow changing a hashtable while going over the entries.
(closes #11435)
|
|
Problem: The WinScrolled autocommand event is not enough.
Solution: Add WinResized and provide information about what changed.
(closes #11576)
|
|
Problem: WinScrolled may trigger immediately when defined.
Solution: Initialize the fields in all windows. (closes #11582)
|
|
Problem: Only a change in the current window triggers the WinScrolled
event.
Solution: Trigger WinScrolled if any window scrolled or changed size.
(issue #11576)
|
|
Problem: Error message for layout change does not match action.
Solution: Pass the command to where the error is given. (closes #11573)
|
|
Problem: Using freed memory when clearing augroup at more prompt.
Solution: Delay clearing augroup until it's safe. (closes #11441)
|
|
Problem: Test for dummy buffer does not always produce the E86 error.
Solution: Do not check if the error is produced.
|
|
Problem: Dummy buffer ends up in a window.
Solution: Disallow navigating to a dummy buffer.
|
|
Problem: ModeChanged autocmd not executed when Visual mode is ended with
CTRL-C.
Solution: Do not trigger the autocmd when got_int is set. (closes #11394)
|
|
Problem: Tests check for +cmdwin feature which is always present.
Solution: Remove the checks. (closes #11287)
|
|
Problem: SpellFileMissing autocmd may delete buffer.
Solution: Disallow deleting the current buffer to avoid using freed memory.
|
|
Problem: A few tests keep failing on MacOS M1.
Solution: Add a test check CheckNotMacM1. Fix timer tests.
|
|
Problem: Crash when closing a tabpage and buffer is NULL.
Solution: Adjust how autocommands are triggered when closing a window.
(closes #11198, closes #11197)
|
|
Problem: Autocmd test uses common file name.
Solution: Use unique name to reduce flakiness.
|
|
Problem: Autocmd test is a bit flaky on MS-Windows.
Solution: Add a bit more sleeping. (Ken Takata, closes #11095)
|
|
Problem: On MS-Windows some tests are flaky.
Solution: Add sleeps, disable swapfile, mark test as flaky. (Ken Takata,
closes #11082)
|
|
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
|
|
Problem: Deleting files in tests is a hassle.
Solution: Use the new 'D' flag of writefile().
|
|
Problem: Common names in test files causes tests to be flaky.
Solution: Use more specific names.
|