From a9764248b799e25c9d3d7143b28315182debe4f5 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 10 Feb 1992 08:12:22 +0000 Subject: [PATCH] *** empty log message *** --- src/dispnew.c | 11 +++++++++-- src/indent.c | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 31e5590f35d..71253511546 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -948,8 +948,15 @@ direct_output_forward_char (n) register SCREEN_PTR screen = selected_screen; register struct window *w = XWINDOW (selected_window); - /* Avoid losing if cursor is in invisible text off left margin */ - if (XINT (w->hscroll) && SCREEN_CURSOR_X (screen) == XFASTINT (w->left)) + /* Avoid losing if cursor is in invisible text off left margin + or about to go off either side of window. */ + if ((SCREEN_CURSOR_X (screen) == XFASTINT (w->left) + && (XINT (w->hscroll) || n < 0)) + || (n > 0 + && (SCREEN_CURSOR_X (screen) + 1 + >= (XFASTINT (w->left) + XFASTINT (w->width) + - (XFASTINT (w->width) < SCREEN_WIDTH (screen)) + - 1)))) return 0; SCREEN_CURSOR_X (screen) += n; diff --git a/src/indent.c b/src/indent.c index a48877d84ce..f87ca13192a 100644 --- a/src/indent.c +++ b/src/indent.c @@ -373,9 +373,9 @@ struct position val_compute_motion; compute_motion uses this to handle continuation lines and such. HSCROLL is the number of columns not being displayed at the left margin; this is usually taken from a window's hscroll member. - TAB_OFFSET is a mysterious value, perhaps the number of columns of - the first tab that aren't being displayed, perhaps because of a - continuation line or something. + TAB_OFFSET is the number of columns of the first tab that aren't + being displayed, perhaps because of a continuation line or + something. compute_motion returns a pointer to a struct position. The bufpos member gives the buffer position at the end of the scan, and hpos -- 2.11.4.GIT