Skip to content

Instantly share code, notes, and snippets.

@mattn
Created December 19, 2012 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/4333634 to your computer and use it in GitHub Desktop.
Save mattn/4333634 to your computer and use it in GitHub Desktop.
diff -r b89e2bdcc6e5 src/eval.c
--- a/src/eval.c Sun Dec 16 12:50:40 2012 +0100
+++ b/src/eval.c Wed Dec 19 10:19:45 2012 +0900
@@ -16536,6 +16536,7 @@
typval_T *argvars;
typval_T *rettv;
{
+ colnr_T save_col;
tabpage_T *save_curtab;
char_u *varname, *tabvarname;
typval_T *varp;
@@ -16552,6 +16553,7 @@
if (tp != NULL && varname != NULL && varp != NULL)
{
+ save_col = curwin->w_cursor.col;
save_curtab = curtab;
goto_tabpage_tp(tp, TRUE);
@@ -16567,6 +16569,8 @@
/* Restore current tabpage */
if (valid_tabpage(save_curtab))
goto_tabpage_tp(save_curtab, TRUE);
+
+ curwin->w_cursor.col = save_col;
}
}
@@ -16602,6 +16606,7 @@
int off;
{
win_T *win;
+ colnr_T save_col;
#ifdef FEAT_WINDOWS
win_T *save_curwin;
tabpage_T *save_curtab;
@@ -16626,6 +16631,7 @@
if (win != NULL && varname != NULL && varp != NULL)
{
+ save_col = curwin->w_cursor.col;
#ifdef FEAT_WINDOWS
/* set curwin to be our win, temporarily */
save_curwin = curwin;
@@ -16672,6 +16678,8 @@
curbuf = curwin->w_buffer;
}
#endif
+
+ curwin->w_cursor.col = save_col;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment