diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-18 21:47:45 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-18 21:55:54 -0400 |
commit | 098e1f9dfd688fdbb5489ac1f4698c7cb5555e0e (patch) | |
tree | 4c110fe6eaf1b4f66bb2d684e444feba6b2b5b3d | |
parent | 98632f1cce66e5dd82c17f7a8da6e447b32fc962 (diff) | |
download | rneovim-098e1f9dfd688fdbb5489ac1f4698c7cb5555e0e.tar.gz rneovim-098e1f9dfd688fdbb5489ac1f4698c7cb5555e0e.tar.bz2 rneovim-098e1f9dfd688fdbb5489ac1f4698c7cb5555e0e.zip |
vim-patch:8.0.0762: ml_get error with :psearch in buffer without a name
Problem: ml_get error with :psearch in buffer without a name. (Dominique
Pelle)
Solution: Use the buffer number instead of the file name. Check the cursor
position.
https://github.com/vim/vim/commit/c31f9ae4f1976544522313b182957793063ee02c
-rw-r--r-- | src/nvim/search.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_preview.vim | 13 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 95929f0eb4..1a49771d45 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4603,7 +4603,7 @@ search_line: if (depth == -1) { // match in current file if (l_g_do_tagpreview != 0) { - if (!GETFILE_SUCCESS(getfile(0, curwin_save->w_buffer->b_fname, + if (!GETFILE_SUCCESS(getfile(curwin_save->w_buffer->b_fnum, NULL, NULL, true, lnum, false))) { break; // failed to jump to file } @@ -4611,6 +4611,7 @@ search_line: setpcmark(); } curwin->w_cursor.lnum = lnum; + check_cursor(); } else { if (!GETFILE_SUCCESS(getfile(0, files[depth].name, NULL, true, files[depth].lnum, false))) { diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 1e3dc04049..5057c8eb0a 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -88,6 +88,7 @@ NEW_TESTS ?= \ test_normal.res \ test_number.res \ test_options.res \ + test_preview.res \ test_profile.res \ test_put.res \ test_python2.res \ diff --git a/src/nvim/testdir/test_preview.vim b/src/nvim/testdir/test_preview.vim new file mode 100644 index 0000000000..91923fb1e9 --- /dev/null +++ b/src/nvim/testdir/test_preview.vim @@ -0,0 +1,13 @@ +" Tests for the preview window + +func Test_Psearch() + " this used to cause ml_get errors + help + let wincount = winnr('$') + 0f + ps. + call assert_equal(wincount + 1, winnr('$')) + pclose + call assert_equal(wincount, winnr('$')) + bwipe +endfunc |