mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-10 13:40:36 -08:00
(compute_motion): Return correctly if skip_invisible
takes us past TO.
This commit is contained in:
parent
098401cfa2
commit
98136db32a
1 changed files with 10 additions and 1 deletions
11
src/indent.c
11
src/indent.c
|
|
@ -997,6 +997,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
|
|||
{
|
||||
while (pos == next_boundary)
|
||||
{
|
||||
int newpos;
|
||||
|
||||
/* If the caller says that the screen position came from an earlier
|
||||
call to compute_motion, then we've already accounted for the
|
||||
overlay strings at point. This is only true the first time
|
||||
|
|
@ -1020,7 +1022,12 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
|
|||
(but not necessarily all that there are here),
|
||||
and store in next_boundary the next position where
|
||||
we need to call skip_invisible. */
|
||||
pos = skip_invisible (pos, &next_boundary, to, window);
|
||||
newpos = skip_invisible (pos, &next_boundary, to, window);
|
||||
|
||||
if (newpos >= to)
|
||||
goto after_loop;
|
||||
|
||||
pos = newpos;
|
||||
}
|
||||
|
||||
/* Handle right margin. */
|
||||
|
|
@ -1361,6 +1368,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
|
|||
}
|
||||
}
|
||||
|
||||
after_loop:
|
||||
|
||||
/* Remember any final width run in the cache. */
|
||||
if (current_buffer->width_run_cache
|
||||
&& width_run_width == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue