]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #2749 with overflow-newline-into-fringe in visual-line-mode.
authorEli Zaretskii <eliz@gnu.org>
Tue, 2 Jul 2013 15:52:07 +0000 (18:52 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 2 Jul 2013 15:52:07 +0000 (18:52 +0300)
 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
src/xdisp.c

index d5907c64942d32196a2e145878e041fa7a15dc36..76cd156a0e72e1833e43e598fc5007974c23865d 100644 (file)
@@ -1,3 +1,16 @@
+2013-07-02  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <jan.h.d@swipnet.se>
 
        * process.c (handle_child_signal): Call catch_child_signal if
index 3fa80336a6147830c989ab96df8a8fa21267f279..b61b976a40102462b19c7e87b8a9ea6b6dd3072e 100644 (file)
@@ -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;