Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emacs: remove broken line overflow behaviour
In emacs.c, some absolute breakage happens when the command line being entered exceeds MAXLINE - 2 (1022) characters: 345: if ((eol+1) >= (scend)) /* will not fit on line */ 346: { 347: ed_ungetchar(ep->ed,c); /* save character for next line */ 348: goto process; 349: } The PS2 line continuation prompt is inserted in the display (without starting a new line) and you cannot backspace beyond it. E.g., when entering a series of more than 1024 'x' characters: [...] xxxxxxxxxxxxxxxxxxxxxxxx> xxxxxxx▂ ^^ $PS2 ^^^^^^^^^now inaccessible^^^^^ Except for the corrupted display of PS2 and the inability to access/edit text preceding it, this sort of works, although it's a botch. However, it's much worse when the maximum command line length is exceeded while inserting new text *before* the current end of the line. PS2 is displayed at the current cursor position, but the overflow character is inserted at the start of the "new" line, and not at the cursor position! And that's where editing continues, though the display is not reflecting this fact. The vi mode simply beeps in this situation, refusing to add more characters when the line is full. From now on, emacs does the same: beep, kill any remaining lookahead, update command line display if necessary, and continue to read the next keyboard input.
- Loading branch information