comparison src/main.c @ 1345:c38cdd201cec v7.1.059

updated for version 7.1-059
author vimboss
date Fri, 10 Aug 2007 19:33:47 +0000
parents e2680bc6a180
children 53b2bedccfdf
comparison
equal deleted inserted replaced
1344:843bfffb04c7 1345:c38cdd201cec
952 void 952 void
953 main_loop(cmdwin, noexmode) 953 main_loop(cmdwin, noexmode)
954 int cmdwin; /* TRUE when working in the command-line window */ 954 int cmdwin; /* TRUE when working in the command-line window */
955 int noexmode; /* TRUE when return on entering Ex mode */ 955 int noexmode; /* TRUE when return on entering Ex mode */
956 { 956 {
957 oparg_T oa; /* operator arguments */ 957 oparg_T oa; /* operator arguments */
958 int previous_got_int = FALSE; /* "got_int" was TRUE */
958 959
959 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) 960 #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
960 /* Setup to catch a terminating error from the X server. Just ignore 961 /* Setup to catch a terminating error from the X server. Just ignore
961 * it, restore the state and continue. This might not always work 962 * it, restore the state and continue. This might not always work
962 * properly, but at least we don't exit unexpectedly when the X server 963 * properly, but at least we don't exit unexpectedly when the X server
1013 /* skip the fileinfo message now, because it would be shown 1014 /* skip the fileinfo message now, because it would be shown
1014 * after insert mode finishes! */ 1015 * after insert mode finishes! */
1015 need_fileinfo = FALSE; 1016 need_fileinfo = FALSE;
1016 } 1017 }
1017 } 1018 }
1018 if (got_int && !global_busy) 1019
1019 { 1020 /* Reset "got_int" now that we got back to the main loop. Except when
1020 if (!quit_more) 1021 * inside a ":g/pat/cmd" command, then the "got_int" needs to abort
1021 (void)vgetc(); /* flush all buffers */ 1022 * the ":g" command.
1022 got_int = FALSE; 1023 * For ":g/pat/vi" we reset "got_int" when used once. When used
1023 } 1024 * a second time we go back to Ex mode and abort the ":g" command. */
1025 if (got_int)
1026 {
1027 if (noexmode && global_busy && !exmode_active && previous_got_int)
1028 {
1029 /* Typed two CTRL-C in a row: go back to ex mode as if "Q" was
1030 * used and keep "got_int" set, so that it aborts ":g". */
1031 exmode_active = EXMODE_NORMAL;
1032 State = NORMAL;
1033 }
1034 else if (!global_busy || !exmode_active)
1035 {
1036 if (!quit_more)
1037 (void)vgetc(); /* flush all buffers */
1038 got_int = FALSE;
1039 }
1040 previous_got_int = TRUE;
1041 }
1042 else
1043 previous_got_int = FALSE;
1044
1024 if (!exmode_active) 1045 if (!exmode_active)
1025 msg_scroll = FALSE; 1046 msg_scroll = FALSE;
1026 quit_more = FALSE; 1047 quit_more = FALSE;
1027 1048
1028 /* 1049 /*