comparison src/os_unix.c @ 216:da182deebec7

updated for version 7.0061
author vimboss
date Fri, 18 Mar 2005 20:25:31 +0000
parents 041a413d626d
children ef254e0f2365
comparison
equal deleted inserted replaced
215:a4029d1d83df 216:da182deebec7
328 int maxlen; 328 int maxlen;
329 long wtime; /* don't use "time", MIPS cannot handle it */ 329 long wtime; /* don't use "time", MIPS cannot handle it */
330 int tb_change_cnt; 330 int tb_change_cnt;
331 { 331 {
332 int len; 332 int len;
333 #ifdef FEAT_AUTOCMD
334 static int once_already = 0;
335 #endif
336 333
337 /* Check if window changed size while we were busy, perhaps the ":set 334 /* Check if window changed size while we were busy, perhaps the ":set
338 * columns=99" command was used. */ 335 * columns=99" command was used. */
339 while (do_resize) 336 while (do_resize)
340 handle_resize(); 337 handle_resize();
342 if (wtime >= 0) 339 if (wtime >= 0)
343 { 340 {
344 while (WaitForChar(wtime) == 0) /* no character available */ 341 while (WaitForChar(wtime) == 0) /* no character available */
345 { 342 {
346 if (!do_resize) /* return if not interrupted by resize */ 343 if (!do_resize) /* return if not interrupted by resize */
347 {
348 #ifdef FEAT_AUTOCMD
349 once_already = 0;
350 #endif
351 return 0; 344 return 0;
352 }
353 handle_resize(); 345 handle_resize();
354 } 346 }
355 } 347 }
356 else /* wtime == -1 */ 348 else /* wtime == -1 */
357 { 349 {
358 #ifdef FEAT_AUTOCMD
359 if (once_already == 2)
360 updatescript(0);
361 else if (once_already == 1)
362 {
363 setcursor();
364 once_already = 2;
365 return 0;
366 }
367 else
368 #endif
369 /* 350 /*
370 * If there is no character available within 'updatetime' seconds 351 * If there is no character available within 'updatetime' seconds
371 * flush all the swap files to disk 352 * flush all the swap files to disk.
372 * Also done when interrupted by SIGWINCH. 353 * Also done when interrupted by SIGWINCH.
373 */ 354 */
374 if (WaitForChar(p_ut) == 0) 355 if (WaitForChar(p_ut) == 0)
375 { 356 {
376 #ifdef FEAT_AUTOCMD 357 #ifdef FEAT_AUTOCMD
377 if (has_cursorhold() && get_real_state() == NORMAL_BUSY) 358 if (!did_cursorhold
359 && has_cursorhold()
360 && get_real_state() == NORMAL_BUSY
361 && maxlen >= 3
362 && !typebuf_changed(tb_change_cnt))
378 { 363 {
379 apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf); 364 buf[0] = K_SPECIAL;
380 update_screen(VALID); 365 buf[1] = KS_EXTRA;
381 once_already = 1; 366 buf[2] = (int)KE_CURSORHOLD;
382 return 0; 367 return 3;
383 } 368 }
384 else 369 #endif
385 #endif 370 updatescript(0);
386 updatescript(0);
387 } 371 }
388 } 372 }
389 373
390 for (;;) /* repeat until we got a character */ 374 for (;;) /* repeat until we got a character */
391 { 375 {
416 int i; 400 int i;
417 401
418 for (i = 0; i < len; i++) 402 for (i = 0; i < len; i++)
419 if (buf[i] == 0) 403 if (buf[i] == 0)
420 buf[i] = K_NUL; 404 buf[i] = K_NUL;
421 #endif
422 #ifdef FEAT_AUTOCMD
423 once_already = 0;
424 #endif 405 #endif
425 return len; 406 return len;
426 } 407 }
427 } 408 }
428 } 409 }