Mercurial > vim
comparison src/ex_getln.c @ 625:81fe2ccc1207 v7.0179
updated for version 7.0179
author | vimboss |
---|---|
date | Thu, 12 Jan 2006 23:22:24 +0000 |
parents | 9e359e5759f6 |
children | b6632d553df3 |
comparison
equal
deleted
inserted
replaced
624:91e7d4a7b3b0 | 625:81fe2ccc1207 |
---|---|
643 { | 643 { |
644 char_u *p = NULL; | 644 char_u *p = NULL; |
645 | 645 |
646 /* | 646 /* |
647 * Replace the command line with the result of an expression. | 647 * Replace the command line with the result of an expression. |
648 * Need to save the current command line, to be able to enter | 648 * Need to save and restore the current command line, to be |
649 * a new one... | 649 * able to enter a new one... |
650 */ | 650 */ |
651 if (ccline.cmdpos == ccline.cmdlen) | 651 if (ccline.cmdpos == ccline.cmdlen) |
652 new_cmdpos = 99999; /* keep it at the end */ | 652 new_cmdpos = 99999; /* keep it at the end */ |
653 else | 653 else |
654 new_cmdpos = ccline.cmdpos; | 654 new_cmdpos = ccline.cmdpos; |
656 save_cmdline(&save_ccline); | 656 save_cmdline(&save_ccline); |
657 c = get_expr_register(); | 657 c = get_expr_register(); |
658 restore_cmdline(&save_ccline); | 658 restore_cmdline(&save_ccline); |
659 if (c == '=') | 659 if (c == '=') |
660 { | 660 { |
661 /* Need to save and restore ccline. And go into the | |
662 * sandbox to avoid nasty things like going to another | |
663 * buffer when evaluating an expression. */ | |
661 save_cmdline(&save_ccline); | 664 save_cmdline(&save_ccline); |
665 #ifdef HAVE_SANDBOX | |
666 ++sandbox; | |
667 #endif | |
662 p = get_expr_line(); | 668 p = get_expr_line(); |
669 #ifdef HAVE_SANDBOX | |
670 --sandbox; | |
671 #endif | |
663 restore_cmdline(&save_ccline); | 672 restore_cmdline(&save_ccline); |
664 | 673 |
665 if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) | 674 if (p != NULL && realloc_cmdbuff((int)STRLEN(p) + 1) == OK) |
666 { | 675 { |
667 ccline.cmdlen = STRLEN(p); | 676 ccline.cmdlen = STRLEN(p); |
1189 #endif | 1198 #endif |
1190 goto cmdline_not_changed; | 1199 goto cmdline_not_changed; |
1191 | 1200 |
1192 case K_IGNORE: | 1201 case K_IGNORE: |
1193 goto cmdline_not_changed; /* Ignore mouse */ | 1202 goto cmdline_not_changed; /* Ignore mouse */ |
1203 | |
1204 #ifdef FEAT_GUI_W32 | |
1205 /* On Win32 ignore <M-F4>, we get it when closing the window was | |
1206 * cancelled. */ | |
1207 case K_F4: | |
1208 if (mod_mask == MOD_MASK_ALT) | |
1209 { | |
1210 redrawcmd(); /* somehow the cmdline is cleared */ | |
1211 goto cmdline_not_changed; | |
1212 } | |
1213 break; | |
1214 #endif | |
1194 | 1215 |
1195 #ifdef FEAT_MOUSE | 1216 #ifdef FEAT_MOUSE |
1196 case K_MIDDLEDRAG: | 1217 case K_MIDDLEDRAG: |
1197 case K_MIDDLERELEASE: | 1218 case K_MIDDLERELEASE: |
1198 goto cmdline_not_changed; /* Ignore mouse */ | 1219 goto cmdline_not_changed; /* Ignore mouse */ |