|
Lines 510-524
next: if (v_event_get(sp, evp, 0, ec_fla
Link Here
|
| 510 |
case E_EOF: |
510 |
case E_EOF: |
| 511 |
F_SET(sp, SC_EXIT_FORCE); |
511 |
F_SET(sp, SC_EXIT_FORCE); |
| 512 |
return (1); |
512 |
return (1); |
| 513 |
case E_INTERRUPT: |
|
|
| 514 |
/* |
| 515 |
* !!! |
| 516 |
* Historically, <interrupt> exited the user from text input |
| 517 |
* mode or cancelled a colon command, and returned to command |
| 518 |
* mode. It also beeped the terminal, but that seems a bit |
| 519 |
* excessive. |
| 520 |
*/ |
| 521 |
goto k_escape; |
| 522 |
case E_REPAINT: |
513 |
case E_REPAINT: |
| 523 |
if (vs_repaint(sp, &ev)) |
514 |
if (vs_repaint(sp, &ev)) |
| 524 |
return (1); |
515 |
return (1); |
|
Lines 526-535
next: if (v_event_get(sp, evp, 0, ec_fla
Link Here
|
| 526 |
case E_WRESIZE: |
517 |
case E_WRESIZE: |
| 527 |
/* <resize> interrupts the input mode. */ |
518 |
/* <resize> interrupts the input mode. */ |
| 528 |
v_emsg(sp, NULL, VIM_WRESIZE); |
519 |
v_emsg(sp, NULL, VIM_WRESIZE); |
| 529 |
goto k_escape; |
520 |
/* FALLTHROUGH */ |
| 530 |
default: |
521 |
default: |
| 531 |
v_event_err(sp, evp); |
522 |
if (evp->e_event != E_INTERRUPT && evp->e_event != E_WRESIZE) |
| 532 |
goto k_escape; |
523 |
v_event_err(sp, evp); |
|
|
524 |
/* |
| 525 |
* !!! |
| 526 |
* Historically, <interrupt> exited the user from text input |
| 527 |
* mode or cancelled a colon command, and returned to command |
| 528 |
* mode. It also beeped the terminal, but that seems a bit |
| 529 |
* excessive. |
| 530 |
*/ |
| 531 |
/* |
| 532 |
* If we are recording, morph into <escape> key so that |
| 533 |
* we can repeat the command safely: there is no way to |
| 534 |
* invalidate the repetition of an instance of a command, |
| 535 |
* which would be the alternative possibility. |
| 536 |
* If we are not recording (most likely on the command line), |
| 537 |
* simply discard the input and return to command mode |
| 538 |
* so that an INTERRUPT doesn't become for example a file |
| 539 |
* completion request. -aymeric |
| 540 |
*/ |
| 541 |
if (LF_ISSET(TXT_RECORD)) { |
| 542 |
evp->e_event = E_CHARACTER; |
| 543 |
evp->e_c = 033; |
| 544 |
evp->e_flags = 0; |
| 545 |
evp->e_value = K_ESCAPE; |
| 546 |
break; |
| 547 |
} else { |
| 548 |
tp->term = TERM_ESC; |
| 549 |
goto k_escape; |
| 550 |
} |
| 533 |
} |
551 |
} |
| 534 |
|
552 |
|
| 535 |
/* |
553 |
/* |