comparison src/os_win32.c @ 203:80000fb16feb

updated for version 7.0060
author vimboss
date Tue, 15 Mar 2005 22:34:55 +0000
parents f529edb9bab3
children bf6ee000a80c
comparison
equal deleted inserted replaced
202:b6450bf509d8 203:80000fb16feb
1321 { 1321 {
1322 #ifndef FEAT_GUI_W32 /* this isn't used for the GUI */ 1322 #ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
1323 1323
1324 int len; 1324 int len;
1325 int c; 1325 int c;
1326 #ifdef FEAT_AUTOCMD
1327 static int once_already = 0;
1328 #endif
1329 #define TYPEAHEADLEN 20 1326 #define TYPEAHEADLEN 20
1330 static char_u typeahead[TYPEAHEADLEN]; /* previously typed bytes. */ 1327 static char_u typeahead[TYPEAHEADLEN]; /* previously typed bytes. */
1331 static int typeaheadlen = 0; 1328 static int typeaheadlen = 0;
1332 1329
1333 /* First use any typeahead that was kept because "buf" was too small. */ 1330 /* First use any typeahead that was kept because "buf" was too small. */
1356 #endif 1353 #endif
1357 1354
1358 if (time >= 0) 1355 if (time >= 0)
1359 { 1356 {
1360 if (!WaitForChar(time)) /* no character available */ 1357 if (!WaitForChar(time)) /* no character available */
1358 return 0;
1359 }
1360 else /* time == -1, wait forever */
1361 {
1362 mch_set_winsize_now(); /* Allow winsize changes from now on */
1363
1364 /*
1365 * If there is no character available within 2 seconds (default)
1366 * write the autoscript file to disk. Or cause the CursorHold event
1367 * to be triggered.
1368 */
1369 if (!WaitForChar(p_ut))
1361 { 1370 {
1362 #ifdef FEAT_AUTOCMD 1371 #ifdef FEAT_AUTOCMD
1363 once_already = 0; 1372 if (!did_cursorhold && has_cursorhold()
1364 #endif 1373 && get_real_state() == NORMAL_BUSY && maxlen >= 3)
1365 return 0;
1366 }
1367 }
1368 else /* time == -1, wait forever */
1369 {
1370 mch_set_winsize_now(); /* Allow winsize changes from now on */
1371
1372 #ifdef FEAT_AUTOCMD
1373 /* If there is no character available within 2 seconds (default),
1374 * write the autoscript file to disk */
1375 if (once_already == 2)
1376 updatescript(0);
1377 else if (once_already == 1)
1378 {
1379 setcursor();
1380 once_already = 2;
1381 return 0;
1382 }
1383 else
1384 #endif
1385 if (!WaitForChar(p_ut))
1386 {
1387 #ifdef FEAT_AUTOCMD
1388 if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
1389 { 1374 {
1390 apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf); 1375 buf[0] = K_SPECIAL;
1391 update_screen(VALID); 1376 buf[1] = KS_EXTRA;
1392 once_already = 1; 1377 buf[2] = (int)KE_CURSORHOLD;
1393 return 0; 1378 return 3;
1394 } 1379 }
1380 else
1395 #endif 1381 #endif
1396 updatescript(0); 1382 updatescript(0);
1397 } 1383 }
1398 } 1384 }
1399 1385
1524 if (fdDump) 1510 if (fdDump)
1525 { 1511 {
1526 fputs("]\n", fdDump); 1512 fputs("]\n", fdDump);
1527 fflush(fdDump); 1513 fflush(fdDump);
1528 } 1514 }
1529 #endif
1530
1531 #ifdef FEAT_AUTOCMD
1532 once_already = 0;
1533 #endif 1515 #endif
1534 1516
1535 theend: 1517 theend:
1536 /* Move typeahead to "buf", as much as fits. */ 1518 /* Move typeahead to "buf", as much as fits. */
1537 len = 0; 1519 len = 0;