# HG changeset patch # User Jim Blandy # Date 697709542 0 # Node ID 937bccff8155ca3629c647dd15717965a8369b2d # Parent 119ba212b686c54cd9fcd58232f9cd679508f027 *** empty log message *** diff -r 119ba212b686 -r 937bccff8155 src/dispnew.c --- a/src/dispnew.c Mon Feb 10 05:20:54 1992 +0000 +++ b/src/dispnew.c Mon Feb 10 08:12:22 1992 +0000 @@ -948,8 +948,15 @@ 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 -r 119ba212b686 -r 937bccff8155 src/indent.c --- a/src/indent.c Mon Feb 10 05:20:54 1992 +0000 +++ b/src/indent.c Mon Feb 10 08:12:22 1992 +0000 @@ -373,9 +373,9 @@ 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