1
0
forked from aniani/vim

patch 8.1.0734: the hlsearch state is not stored in a session file

Problem:    The hlsearch state is not stored in a session file.
Solution:   Add "nohlsearch" if appropriate. (Jason Franklin)
This commit is contained in:
Bram Moolenaar 2019-01-12 16:29:30 +01:00
parent 2be7cb73f6
commit e3c74d249a
3 changed files with 24 additions and 0 deletions

View File

@ -10144,6 +10144,10 @@ ex_mkrc(
if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save")
== FAIL)
failed = TRUE;
# ifdef FEAT_SEARCH_EXTRA
if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL)
failed = TRUE;
# endif
if (put_line(fd, "doautoall SessionLoadPost") == FAIL)
failed = TRUE;
if (eap->cmdidx == CMD_mksession)

View File

@ -198,6 +198,24 @@ func Test_mksession_blank_tabs()
call delete('Xtest_mks.out')
endfunc
if has('extra_search')
func Test_mksession_hlsearch()
set hlsearch
mksession! Xtest_mks.out
nohlsearch
source Xtest_mks.out
call assert_equal(1, v:hlsearch, 'session should restore search highlighting state')
nohlsearch
mksession! Xtest_mks.out
source Xtest_mks.out
call assert_equal(0, v:hlsearch, 'session should restore search highlighting state')
call delete('Xtest_mks.out')
endfunc
endif
func Test_mksession_blank_windows()
split
split

View File

@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
734,
/**/
733,
/**/