comparison src/getchar.c @ 1462:ceaf71b15d81 v7.1.177

updated for version 7.1-177
author vimboss
date Tue, 01 Jan 2008 13:17:56 +0000
parents ca501ab2fdb3
children 46bbe11644e0
comparison
equal deleted inserted replaced
1461:76406c9cbbaa 1462:ceaf71b15d81
1277 * Free the buffers of "typebuf". 1277 * Free the buffers of "typebuf".
1278 */ 1278 */
1279 void 1279 void
1280 free_typebuf() 1280 free_typebuf()
1281 { 1281 {
1282 vim_free(typebuf.tb_buf); 1282 if (typebuf.tb_buf == typebuf_init)
1283 vim_free(typebuf.tb_noremap); 1283 EMSG2(_(e_intern2), "Free typebuf 1");
1284 else
1285 vim_free(typebuf.tb_buf);
1286 if (typebuf.tb_buf == noremapbuf_init)
1287 EMSG2(_(e_intern2), "Free typebuf 2");
1288 else
1289 vim_free(typebuf.tb_noremap);
1284 } 1290 }
1285 1291
1286 /* 1292 /*
1287 * When doing ":so! file", the current typeahead needs to be saved, and 1293 * When doing ":so! file", the current typeahead needs to be saved, and
1288 * restored when "file" has been read completely. 1294 * restored when "file" has been read completely.
1357 if (curscript + 1 == NSCRIPT) 1363 if (curscript + 1 == NSCRIPT)
1358 { 1364 {
1359 EMSG(_(e_nesting)); 1365 EMSG(_(e_nesting));
1360 return; 1366 return;
1361 } 1367 }
1368 #ifdef FEAT_EVAL
1369 if (ignore_script)
1370 /* Not reading from script, also don't open one. Warning message? */
1371 return;
1372 #endif
1362 1373
1363 if (scriptin[curscript] != NULL) /* already reading script */ 1374 if (scriptin[curscript] != NULL) /* already reading script */
1364 ++curscript; 1375 ++curscript;
1365 /* use NameBuff for expanded name */ 1376 /* use NameBuff for expanded name */
1366 expand_env(name, NameBuff, MAXPATHL); 1377 expand_env(name, NameBuff, MAXPATHL);
2344 current_menu->noremap[idx], 2355 current_menu->noremap[idx],
2345 0, TRUE, 2356 0, TRUE,
2346 current_menu->silent[idx]); 2357 current_menu->silent[idx]);
2347 } 2358 }
2348 } 2359 }
2349 #endif /* FEAT_GUI */ 2360 #endif /* FEAT_GUI && FEAT_MENU */
2350 continue; /* try mapping again */ 2361 continue; /* try mapping again */
2351 } 2362 }
2352 2363
2353 /* Partial match: get some more characters. When a 2364 /* Partial match: get some more characters. When a
2354 * matching mapping was found use that one. */ 2365 * matching mapping was found use that one. */
2860 did_swapwrite_msg = FALSE; /* display swap file write error again */ 2871 did_swapwrite_msg = FALSE; /* display swap file write error again */
2861 } 2872 }
2862 undo_off = FALSE; /* restart undo now */ 2873 undo_off = FALSE; /* restart undo now */
2863 2874
2864 /* 2875 /*
2865 * first try script file 2876 * Get a character from a script file if there is one.
2866 * If interrupted: Stop reading script files. 2877 * If interrupted: Stop reading script files, close them all.
2867 */ 2878 */
2868 script_char = -1; 2879 script_char = -1;
2869 while (scriptin[curscript] != NULL && script_char < 0) 2880 while (scriptin[curscript] != NULL && script_char < 0
2881 #ifdef FEAT_EVAL
2882 && !ignore_script
2883 #endif
2884 )
2870 { 2885 {
2871 if (got_int || (script_char = getc(scriptin[curscript])) < 0) 2886 if (got_int || (script_char = getc(scriptin[curscript])) < 0)
2872 { 2887 {
2873 /* Reached EOF. 2888 /* Reached EOF.
2874 * Careful: closescript() frees typebuf.tb_buf[] and buf[] may 2889 * Careful: closescript() frees typebuf.tb_buf[] and buf[] may