comparison src/getchar.c @ 11490:6a06738f8948 v8.0.0628

patch 8.0.0628: cursor disappears after silent mapping commit https://github.com/vim/vim/commit/f085f4266e07b36279c56d43fd0d73ed080046ae Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 7 20:39:47 2017 +0200 patch 8.0.0628: cursor disappears after silent mapping Problem: Cursor disappears after silent mapping. (Ramel Eshed) Solution: Do restore the cursor when it was changed, but don't change it in the first place for a silent mapping.
author Christian Brabandt <cb@256bit.org>
date Wed, 07 Jun 2017 20:45:03 +0200
parents 1658ac359af1
children 2bc04093ed28
comparison
equal deleted inserted replaced
11489:a7fa3a540af2 11490:6a06738f8948
2581 2581
2582 /* 2582 /*
2583 * get a character: 3. from the user - handle <Esc> in Insert mode 2583 * get a character: 3. from the user - handle <Esc> in Insert mode
2584 */ 2584 */
2585 /* 2585 /*
2586 * special case: if we get an <ESC> in insert mode and there 2586 * Special case: if we get an <ESC> in insert mode and there
2587 * are no more characters at once, we pretend to go out of 2587 * are no more characters at once, we pretend to go out of
2588 * insert mode. This prevents the one second delay after 2588 * insert mode. This prevents the one second delay after
2589 * typing an <ESC>. If we get something after all, we may 2589 * typing an <ESC>. If we get something after all, we may
2590 * have to redisplay the mode. That the cursor is in the wrong 2590 * have to redisplay the mode. That the cursor is in the wrong
2591 * place does not matter. 2591 * place does not matter.
2615 { 2615 {
2616 unshowmode(TRUE); 2616 unshowmode(TRUE);
2617 mode_deleted = TRUE; 2617 mode_deleted = TRUE;
2618 } 2618 }
2619 #ifdef FEAT_GUI 2619 #ifdef FEAT_GUI
2620 /* may show different cursor shape */ 2620 /* may show a different cursor shape */
2621 if (gui.in_use) 2621 if (gui.in_use && State != NORMAL && !cmd_silent)
2622 { 2622 {
2623 int save_State; 2623 int save_State;
2624 2624
2625 save_State = State; 2625 save_State = State;
2626 State = NORMAL; 2626 State = NORMAL;
2911 showmode(); 2911 showmode();
2912 } 2912 }
2913 } 2913 }
2914 #ifdef FEAT_GUI 2914 #ifdef FEAT_GUI
2915 /* may unshow different cursor shape */ 2915 /* may unshow different cursor shape */
2916 if (gui.in_use) 2916 if (gui.in_use && shape_changed)
2917 { 2917 gui_update_cursor(TRUE, FALSE);
2918 if (cmd_silent)
2919 gui_dont_update_cursor(TRUE);
2920 else
2921 gui_can_update_cursor();
2922
2923 if (shape_changed)
2924 gui_update_cursor(TRUE, FALSE);
2925 }
2926 #endif 2918 #endif
2927 2919
2928 --vgetc_busy; 2920 --vgetc_busy;
2929 2921
2930 return c; 2922 return c;