From: Richard M. Stallman Date: Fri, 8 May 1998 02:28:22 +0000 (+0000) Subject: (compute_motion): Undo both May 7 changes. X-Git-Tag: emacs-20.3~1083 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=33fe7d20594231746cb7c0be094c2a924f8dee43;p=emacs.git (compute_motion): Undo both May 7 changes. --- diff --git a/src/indent.c b/src/indent.c index 8f29b9cc24f..639cfdae818 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1223,9 +1223,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, } /* Stop if past the target buffer position or screen position. */ - if (pos > to - || vpos > tovpos - || vpos == tovpos && tohpos >= 0 && hpos > tohpos) + if (pos > to) { /* Go back to the previous position. */ pos = prev_pos; @@ -1258,6 +1256,24 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, break; } + if (vpos > tovpos || vpos == tovpos && hpos >= tohpos) + { + if (contin_hpos && prev_hpos == 0 + && ((hpos > tohpos && contin_hpos == width) + || (wide_column_end_hpos > width))) + { /* Line breaks because we can't put the character at the + previous line any more. It is not the multi-column + character continued in middle. Go back to previous + buffer position, screen position, and set tab offset + to previous value. It's the beginning of the + line. */ + pos = prev_pos; + pos_byte = prev_pos_byte; + hpos = prev_hpos; + tab_offset = prev_tab_offset; + } + break; + } if (pos == ZV) /* We cannot go beyond ZV. Stop here. */ break;