Problem: A TextChanged autocmd triggers when it is defined after creating a
buffer.
Solution: Set b_last_changedtick when opening a buffer. (Hirohito Highlight,
closesvim/vim#2742)
8c64a36e40
Problem: Using setline() in TextChangedI splits undo.
Solution: Use another solution for undo not working properly.
9fa9506853
This deviates from Vim in the handling of the CursorHoldI event. In
Vim, any buffer changes are merged into the insert. In Neovim,
CursorHoldI is handled via the multiqueue, and the point at which
the cursor hold is implemented (in input.c) doesn't know enough about it.
Making all queued events merge into the insert seems more wronger since
changes by other asynchronous events really should be separately
undoable.
Problem: Still too many old style tests.
Solution: Convert a few more tests to new style. (Yegappan Lakshmanan,
closesvim/vim#2272)
430dc5d360
Skip Test_tag_file_encoding.
083_tag_search_with_file_encoding_spec.lua handles the same test case.
Problem: No autocmd triggered in Insert mode with visible popup menu.
Solution: Add TextChangedP. (Prabir Shrestha, Christian Brabandt,
closesvim/vim#2372, closesvim/vim#1691)
Fix that the TextChanged autocommands are not always triggered
when sourcing a script.
5a09343719
This test exposes a bug (present on current master).
Steps to reproduce:
CC=clang make CMAKE_BUILD_TYPE=Debug CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer
TEST_FILE=test_autocmd.res make oldtest
==3668==ERROR: AddressSanitizer: heap-use-after-free on address 0x6260001411c8 at pc 0x000000a38a47 bp 0x7fff9982ee50 sp 0x7fff9982ee48
READ of size 4 at 0x6260001411c8 thread T0
0 0xa38a46 in _typval_encode_nothing_convert_one_value /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:320:15
1 0xa340d5 in encode_vim_to_nothing /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:830:9
2 0xa0ad63 in tv_clear /home/vagrant/neovim/build/../src/nvim/eval/typval.c:2189:25
3 0x85d584 in vars_clear_ext /home/vagrant/neovim/build/../src/nvim/eval.c:18894:9
4 0x7efac9 in vars_clear /home/vagrant/neovim/build/../src/nvim/eval.c:18871:3
5 0x7ef471 in eval_clear /home/vagrant/neovim/build/../src/nvim/eval.c:638:3
6 0xf80a7c in free_all_mem /home/vagrant/neovim/build/../src/nvim/memory.c:676:3
7 0x12789dc in mch_exit /home/vagrant/neovim/build/../src/nvim/os_unix.c:152:3
8 0xe85039 in getout /home/vagrant/neovim/build/../src/nvim/main.c:671:3
9 0xbb4496 in ex_quit_all /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:6051:5
10 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
11 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
12 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
13 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
14 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
15 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
16 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
17 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
18 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
19 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
20 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
21 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
22 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
23 0xb34015 in do_cmdline_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:280:10
24 0xe829d3 in exe_commands /home/vagrant/neovim/build/../src/nvim/main.c:1702:5
25 0xe708bd in main /home/vagrant/neovim/build/../src/nvim/main.c:524:5
26 0x7f0cd5b7e82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
27 0x44d628 in _start (/home/vagrant/neovim/build/bin/nvim+0x44d628)
0x6260001411c8 is located 200 bytes inside of 10256-byte region [0x626000141100,0x626000143910)
freed by thread T0 here:
0 0x50df60 in __interceptor_cfree.localalias.0 (/home/vagrant/neovim/build/bin/nvim+0x50df60)
1 0xf7dbe4 in xfree /home/vagrant/neovim/build/../src/nvim/memory.c:133:3
2 0x676577 in free_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:749:5
3 0x66e15b in close_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:590:5
4 0x67a835 in do_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:1216:9
5 0x681a1d in do_bufdel /home/vagrant/neovim/build/../src/nvim/buffer.c:945:16
6 0xb9cd72 in ex_bunload /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:4585:17
7 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
8 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
9 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
10 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
11 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
12 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
13 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
14 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
15 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
16 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
17 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
18 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
19 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
20 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
21 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
22 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
23 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
24 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
25 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
26 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
27 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
28 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
29 0xb34015 in do_cmdline_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:280:10
previously allocated by thread T0 here:
0 0x50e340 in calloc (/home/vagrant/neovim/build/bin/nvim+0x50e340)
1 0xf7dc97 in xcalloc /home/vagrant/neovim/build/../src/nvim/memory.c:147:15
2 0x67eb65 in buflist_new /home/vagrant/neovim/build/../src/nvim/buffer.c:1641:11
3 0xa8fdcc in do_ecmd /home/vagrant/neovim/build/../src/nvim/ex_cmds.c:2221:13
4 0x683b21 in empty_curbuf /home/vagrant/neovim/build/../src/nvim/buffer.c:1031:12
5 0x67a098 in do_buffer /home/vagrant/neovim/build/../src/nvim/buffer.c:1196:14
6 0x68173f in do_bufdel /home/vagrant/neovim/build/../src/nvim/buffer.c:927:11
7 0xb9cd72 in ex_bunload /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:4585:17
8 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
9 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
10 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
11 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
12 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
13 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
14 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
15 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
16 0x8646b1 in ex_execute /home/vagrant/neovim/build/../src/nvim/eval.c:19478:7
17 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
18 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
19 0x845302 in call_user_func /home/vagrant/neovim/build/../src/nvim/eval.c:21332:3
20 0x81097b in call_func /home/vagrant/neovim/build/../src/nvim/eval.c:6358:11
21 0x825778 in get_func_tv /home/vagrant/neovim/build/../src/nvim/eval.c:6120:11
22 0x81e361 in ex_call /home/vagrant/neovim/build/../src/nvim/eval.c:2735:9
23 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
24 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
25 0xb17fdd in do_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2973:3
26 0xb14630 in cmd_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2718:14
27 0xb14727 in ex_source /home/vagrant/neovim/build/../src/nvim/ex_cmds2.c:2699:3
28 0xb4ba9c in do_one_cmd /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:2242:5
29 0xb2dd03 in do_cmdline /home/vagrant/neovim/build/../src/nvim/ex_docmd.c:609:20
SUMMARY: AddressSanitizer: heap-use-after-free /home/vagrant/neovim/build/../src/nvim/eval/typval_encode.c.h:320:15 in _typval_encode_nothing_convert_one_va
lue
Shadow bytes around the buggy address:
0x0c4c800201e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4c800201f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4c80020200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4c80020210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4c80020220: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c4c80020230: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd
0x0c4c80020240: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4c80020250: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4c80020260: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4c80020270: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c4c80020280: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==3668==ABORTING
Problem: Crash with nasty autocommand. (gy741, Dominique Pelle)
Solution: Check that the new current buffer isn't wiped out. (closesvim/vim#2447)
9bca805ec4
Problem: The OptionSet autocommand event is not triggered when entering
diff mode.
Solution: use set_option_value() instead of setting the option directly.
Change the tests from old to new style. (Christian Brabandt)
04f62f881c
Problem: Still quite a few old style tests.
Solution: Convert old to new style tests. (Yegappan Lakshmanan)
Avoid ringing the bell while running tests.
4a6fcf8047
Problem: Still many old style tests.
Solution: Convert several tests to new style. (Yegappan Lakshmanan)
4a137b4586
vim-patch:8.0.0862: file size test fails on MS-Windows
Problem: File size test fails on MS-Windows.
Solution: Set fileformat after opening new buffer. Strip CR.
07c043af5f
vim-patch:fafcf0dd59fd
patch 8.0.1206: no autocmd for entering or leaving the command line
Problem: No autocmd for entering or leaving the command line.
Solution: Add CmdlineEnter and CmdlineLeave.
fafcf0dd59
Problem: Two autocmd tests are skipped on MS-Windows.
Solution: Make the test pass on MS-Windows. Write the messages in a file
instead of getting the output of system().
e94260f358
Problem: Not all windows commands are tested.
Solution: Add more tests for windows commands. (Dominique Pelle,
closesvim/vim#1575) Run test_autocmd separately, it interferes with
other tests. Fix tests that depended on side effects.
4520d440c5
Problem: Autocommand test fails when run directly, passes when run as
part of test_alot.
Solution: Add command to make the cursor move. Close a tab page.
Problem: Crash when editing a new buffer and BufUnload autocommand wipes
out the new buffer. (Norio Takagi)
Solution: Don't allow wiping out this buffer. (partly by Hirohito Higashi)
Move old style test13 into test_autocmd. Avoid ml_get error when
editing a file.
e0ab94e712
Problem: When opening a buffer on a directory and inside a try/catch then
the BufEnter event is not triggered.
Solution: Return NOTDONE from readfile() for a directory and deal with the
three possible return values. (Justin M. Keyes, closesvim/vim#1375,
closesvim/vim#1353)
e13b9afe12
Problem: Crash and endless loop when closing windows in a SessionLoadPost
autocommand.
Solution: Check for valid tabpage. (partly neovim/neovim#6308)
8c752bd6c4Closes#6308
Problem: Get warning for deleting autocommand group when the autocommand
using the group is scheduled for deletion. (Pavol Juhas)
Solution: Check for deleted autocommand.
5c80908ced
Problem: Deleting an augroup that still has autocmds does not give a
warning. The next defined augroup takes its place.
Solution: Give a warning and prevent the index being used for another group
name.
f2c4c39119
Problem: Crash when using tabnext in BufUnload autocmd. (Norio Takagi)
Solution: First check that the current buffer is the right one. (Hirohito
Higashi)
30445cb6e9
Problem: The BufUnload event is triggered twice, when :bunload is used with
set to or .
Solution: Do not trigger the event when ml_mfp is NULL. (Hirohito Higashi)
c67e892134
vim-patch:7.4.1758
Problem: Triggering CursorHoldI when in CTRL-X mode causes problems.
Solution: Do not trigger CursorHoldI in CTRL-X mode. Add "!" flag to
feedkeys() (test with that didn't work though).
245c41070c
vim-patch:7.4.1759
Problem: When using feedkeys() in a timer the inserted characters are not
used right away.
Solution: Break the wait loop when characters have been added to typebuf.
use this for testing CursorHoldI.
40b1b5443c
vim-patch:7.4.1692
Problem: feedkeys('i', 'x') gets stuck, waits for a character to be typed.
Solution: Behave like ":normal". (Yasuhiro Matsumoto)