From bcffb5caf88767615b86aea7372b56c29dadfbc9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 2 Jul 2013 18:52:07 +0300 Subject: [PATCH] Fix bug #2749 with overflow-newline-into-fringe in visual-line-mode. src/xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow word-wrap, so that overflow-newline-into-fringe would work in visual-line-mode. (move_it_in_display_line_to): When the last scanned display element fits exactly on the display line, and overflow-newline-into-fringe is non-nil, but wrap_it is valid, don't return MOVE_NEWLINE_OR_CR, but instead back up to the last wrap point and return MOVE_LINE_CONTINUED. Fixes problems with finding buffer position that corresponds to pixel coordinates, e.g. in buffer_posn_from_coords. --- src/ChangeLog | 13 +++++++++++++ src/xdisp.c | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d5907c64942..76cd156a0e7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2013-07-02 Eli Zaretskii + + * xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow + word-wrap, so that overflow-newline-into-fringe would work in + visual-line-mode. (Bug#2749) + (move_it_in_display_line_to): When the last scanned display + element fits exactly on the display line, and + overflow-newline-into-fringe is non-nil, but wrap_it is valid, + don't return MOVE_NEWLINE_OR_CR, but instead back up to the last + wrap point and return MOVE_LINE_CONTINUED. Fixes problems with + finding buffer position that corresponds to pixel coordinates, + e.g. in buffer_posn_from_coords. + 2013-07-02 Jan Djärv * process.c (handle_child_signal): Call catch_child_signal if diff --git a/src/xdisp.c b/src/xdisp.c index 3fa80336a61..b61b976a401 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -378,8 +378,7 @@ static Lisp_Object Qline_height; && ((IT)->bidi_it.paragraph_dir == R2L \ ? (WINDOW_LEFT_FRINGE_WIDTH ((IT)->w) > 0) \ : (WINDOW_RIGHT_FRINGE_WIDTH ((IT)->w) > 0)) \ - && (IT)->current_x == (IT)->last_visible_x \ - && (IT)->line_wrap != WORD_WRAP) + && (IT)->current_x == (IT)->last_visible_x) #else /* !HAVE_WINDOW_SYSTEM */ #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) 0 @@ -8539,7 +8538,9 @@ move_it_in_display_line_to (struct it *it, result = MOVE_LINE_CONTINUED; break; } - if (ITERATOR_AT_END_OF_LINE_P (it)) + if (ITERATOR_AT_END_OF_LINE_P (it) + && (it->line_wrap != WORD_WRAP + || wrap_it.sp < 0)) { result = MOVE_NEWLINE_OR_CR; break; -- 2.39.2