Bram,
I noticed the cursor shape being wrong sometimes and decided to finally track
it down. You can make the cursor stay in normal mode shape without leaving
insert mode as follows:
vim -u NONE -i NONE -N -c 'let &t_SI="\<Esc>[5 q"' -c 'let &t_EI="\<Esc>[1 q"'
-c 'autocmd CompleteDone * norm! ==' -c 'call feedkeys("i\<C-n> ", "t")'
That will put you in insert mode with a normal mode cursor shape (in terminal
Vim but not in gVim). The cursor shape is changing in normal.c:590 which is in
the normal_cmd() function.
One way to fix it would be to update cursor shape again after State is restored
at the end of ex_normal() as below. I'm not sure if it should be fixed that way
or if the existing check should be corrected somehow.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9528,6 +9528,13 @@
/* Restore the state (needed when called from a function executed for
* 'indentexpr'). */
State = save_State;
+
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+# ifdef FEAT_MOUSESHAPE
+ update_mouseshape(-1);
+# endif
+#endif
#ifdef FEAT_MBYTE
vim_free(arg);
#endif
Thanks,
Jacob Niehus
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.