diff src/evalfunc.c @ 26978:aa613a3084b9 v8.2.4018

patch 8.2.4018: ml_get error when win_execute redraws with Visual selection Commit: https://github.com/vim/vim/commit/18f4740f043b353abe47b7a00131317052457686 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 6 13:24:51 2022 +0000 patch 8.2.4018: ml_get error when win_execute redraws with Visual selection Problem: ml_get error when win_execute redraws with Visual selection. Solution: Disable Visual area temporarily. (closes https://github.com/vim/vim/issues/9479)
author Bram Moolenaar <Bram@vim.org>
date Thu, 06 Jan 2022 14:30:05 +0100
parents ac75c145f0a9
children 268f6a3511df
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -6864,8 +6864,7 @@ f_line(typval_T *argvars, typval_T *rett
     int		id;
     tabpage_T	*tp;
     win_T	*wp;
-    win_T	*save_curwin;
-    tabpage_T	*save_curtab;
+    switchwin_T	switchwin;
 
     if (in_vim9script()
 	    && (check_for_string_arg(argvars, 0) == FAIL
@@ -6879,13 +6878,12 @@ f_line(typval_T *argvars, typval_T *rett
 	wp = win_id2wp_tp(id, &tp);
 	if (wp != NULL && tp != NULL)
 	{
-	    if (switch_win_noblock(&save_curwin, &save_curtab, wp, tp, TRUE)
-									 == OK)
+	    if (switch_win_noblock(&switchwin, wp, tp, TRUE) == OK)
 	    {
 		check_cursor();
 		fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
 	    }
-	    restore_win_noblock(save_curwin, save_curtab, TRUE);
+	    restore_win_noblock(&switchwin, TRUE);
 	}
     }
     else