mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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.
This commit is contained in:
parent
1f2903c431
commit
c31f9ae4f1
@ -2216,6 +2216,7 @@ test_arglist \
|
|||||||
test_perl \
|
test_perl \
|
||||||
test_plus_arg_edit \
|
test_plus_arg_edit \
|
||||||
test_popup \
|
test_popup \
|
||||||
|
test_preview \
|
||||||
test_profile \
|
test_profile \
|
||||||
test_put \
|
test_put \
|
||||||
test_python2 \
|
test_python2 \
|
||||||
|
@ -5425,7 +5425,7 @@ search_line:
|
|||||||
if (g_do_tagpreview != 0)
|
if (g_do_tagpreview != 0)
|
||||||
{
|
{
|
||||||
if (!GETFILE_SUCCESS(getfile(
|
if (!GETFILE_SUCCESS(getfile(
|
||||||
0, curwin_save->w_buffer->b_fname,
|
curwin_save->w_buffer->b_fnum, NULL,
|
||||||
NULL, TRUE, lnum, FALSE)))
|
NULL, TRUE, lnum, FALSE)))
|
||||||
break; /* failed to jump to file */
|
break; /* failed to jump to file */
|
||||||
}
|
}
|
||||||
@ -5433,6 +5433,7 @@ search_line:
|
|||||||
#endif
|
#endif
|
||||||
setpcmark();
|
setpcmark();
|
||||||
curwin->w_cursor.lnum = lnum;
|
curwin->w_cursor.lnum = lnum;
|
||||||
|
check_cursor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -175,6 +175,7 @@ NEW_TESTS = test_arabic.res \
|
|||||||
test_packadd.res \
|
test_packadd.res \
|
||||||
test_paste.res \
|
test_paste.res \
|
||||||
test_perl.res \
|
test_perl.res \
|
||||||
|
test_preview.res \
|
||||||
test_profile.res \
|
test_profile.res \
|
||||||
test_python2.res \
|
test_python2.res \
|
||||||
test_python3.res \
|
test_python3.res \
|
||||||
|
13
src/testdir/test_preview.vim
Normal file
13
src/testdir/test_preview.vim
Normal file
@ -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
|
@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
762,
|
||||||
/**/
|
/**/
|
||||||
761,
|
761,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user