Skip to content

Commit

Permalink
maple/edit.c: vedit(): ve_key: Allow backspaces and refine delete…
Browse files Browse the repository at this point in the history
…s in ANSI mode.
  • Loading branch information
IepIweidieng committed Dec 10, 2019
1 parent b37108a commit d52ad44
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions maple/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,14 +1875,11 @@ vedit(

case Ctrl('H'): /* backspace */

/* Thor: 在 ANSI 編輯模式下, 不可以按倒退, 不然會很可怕.... */

if (mode & VE_ANSI)
goto ve_key;

if (col)
{
delete_char(vln, ve_col = --col);
ve_col = (mode & VE_ANSI) ? ansi2n(pos - 1, vln) : col - 1;
delete_char(vln, ve_col);
continue;
}

Expand Down Expand Up @@ -1912,9 +1909,9 @@ vedit(
{
if (cc == 0)
goto ve_key;
delete_char(vln, col);
if (mode & VE_ANSI) /* Thor: 雖然增加 load, 不過edit 時會比較好看 */
ve_col = ansi2n(n2ansi(col, vln), vln);
/* Thor: 雖然增加 load, 不過edit 時會比較好看 */
ve_col = (mode & VE_ANSI) ? ansi2n(pos, vln) : pos;
delete_char(vln, ve_col);
}
continue;

Expand Down

0 comments on commit d52ad44

Please sign in to comment.