summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2011-11-25 21:52:46 +0200
committerEli Zaretskii <eliz@gnu.org>2011-11-25 21:52:46 +0200
commit91b4a718988e9d56c2e135d3d41ae3578cbacffd (patch)
tree471f9c3ddeaa037216fe3ce99e711bfb27931dae
parent4ad3bc2a221e84930ac53f09972a7b46362e4f21 (diff)
downloademacs-91b4a718988e9d56c2e135d3d41ae3578cbacffd.tar.gz
Fix bug #10119 with C-e and whitespace-mode.
src/xdisp.c (start_display): Don't move to the next line if the display should start at a newline that is part of a display vector or an overlay string.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fe7080f9c02..6d1a645c3ee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,9 @@
after recentering, and scroll-conservatively is set to a large
number, scroll window by a few more lines to make the cursor fully
visible and out of scroll-margin. (Bug#10105)
+ (start_display): Don't move to the next line if the display should
+ start at a newline that is part of a display vector or an overlay
+ string. (Bug#10119)
2011-11-24 Juri Linkov <juri@jurta.org>
diff --git a/src/xdisp.c b/src/xdisp.c
index 9397d15acb7..921155940b5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2846,8 +2846,14 @@ start_display (struct it *it, struct window *w, struct text_pos pos)
|| (new_x == it->last_visible_x
&& FRAME_WINDOW_P (it->f))))
{
- if (it->current.dpvec_index >= 0
- || it->current.overlay_string_index >= 0)
+ if ((it->current.dpvec_index >= 0
+ || it->current.overlay_string_index >= 0)
+ /* If we are on a newline from a display vector or
+ overlay string, then we are already at the end of
+ a screen line; no need to go to the next line in
+ that case, as this line is not really continued.
+ (If we do go to the next line, C-e will not DTRT.) */
+ && it->c != '\n')
{
set_iterator_to_next (it, 1);
move_it_in_display_line_to (it, -1, -1, 0);