From b497d313738ee08e75dad88a1d5342bfce0868b3 Mon Sep 17 00:00:00 2001 From: Steve Price Date: Mon, 29 Dec 1997 03:29:29 +0000 Subject: Handle the condition where BS is typed while the cursor is at the first position on either of the last two lines of the screen. Ie. append contents of current line to the previous line and scroll the next line's contents up. PR: 5392 Submitted by: Kouichi Hirabayashi --- lib/libncurses/lib_insdel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libncurses') diff --git a/lib/libncurses/lib_insdel.c b/lib/libncurses/lib_insdel.c index aca7cc39dfd2..73d736506c4a 100644 --- a/lib/libncurses/lib_insdel.c +++ b/lib/libncurses/lib_insdel.c @@ -25,7 +25,9 @@ winsdelln(WINDOW *win, int n) if (n == 0) return OK; - if (n < 0 && win->_cury - n >= win->_maxy) + if (n == -1 && win->_cury == win->_maxy) + return wclrtoeol(win); + if (n < 0 && win->_cury - n > win->_maxy) /* request to delete too many lines */ /* should we truncate to an appropriate number? */ return ERR; -- cgit v1.2.3