diff src/search.c @ 11759:5e36b2f825cb v8.0.0762

patch 8.0.0762: ml_get error with :psearch in buffer without a name commit https://github.com/vim/vim/commit/c31f9ae4f1976544522313b182957793063ee02c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 23 22:02:02 2017 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sun, 23 Jul 2017 22:15:04 +0200
parents 578df034735d
children 68d7bc045dbe
line wrap: on
line diff
--- a/src/search.c
+++ b/src/search.c
@@ -5425,7 +5425,7 @@ search_line:
 			if (g_do_tagpreview != 0)
 			{
 			    if (!GETFILE_SUCCESS(getfile(
-					    0, curwin_save->w_buffer->b_fname,
+					   curwin_save->w_buffer->b_fnum, NULL,
 						     NULL, TRUE, lnum, FALSE)))
 				break;	/* failed to jump to file */
 			}
@@ -5433,6 +5433,7 @@ search_line:
 #endif
 			    setpcmark();
 			curwin->w_cursor.lnum = lnum;
+			check_cursor();
 		    }
 		    else
 		    {