Skip to content

Commit

Permalink
Ctrl+U: Only delete from start of line to cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Sep 8, 2024
1 parent ac81ca6 commit 3bbe0fc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/editline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,15 @@ static el_status_t bk_word(void)
return CSstay;
}

static el_status_t bk_kill_line(void)
{
beg_line();
if (old_point != rl_point)
return delete_string(old_point - rl_point);

return CSstay;
}

static el_status_t meta(void)
{
int c;
Expand Down Expand Up @@ -1156,14 +1165,7 @@ static el_status_t tty_special(int c)
return bk_del_char();

if (c == rl_kill) {
if (rl_point != 0) {
old_point = rl_point;
rl_point = 0;
reposition(c);
}
Repeat = NO_ARG;

return kill_line();
return bk_kill_line();
}

#ifdef CONFIG_EOF
Expand Down

0 comments on commit 3bbe0fc

Please sign in to comment.