Hi list.

------------------
tabnew
autocmd InsertEnter * call settabvar(1, 'foo', 0)
put ='foo!'
call feedkeys('A', 't')
------------------

When :source above code, cursor should be end of the line, i.e. next of !.
but it move back to last `o`. Below is a patch, please check.

https://gist.github.com/4333634

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;
     }
 }
 
- Yasuhiro Matsumoto

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui