emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102421: Fix bug #7417 with cursor po


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102421: Fix bug #7417 with cursor positioning on empty lines.
Date: Wed, 17 Nov 2010 21:15:24 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102421
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2010-11-17 21:15:24 +0200
message:
  Fix bug #7417 with cursor positioning on empty lines.
  
   xdisp.c (set_cursor_from_row): Fix cursor positioning in empty
   lines on text-mode terminals.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-11-17 15:12:02 +0000
+++ b/src/ChangeLog     2010-11-17 19:15:24 +0000
@@ -1,3 +1,8 @@
+2010-11-17  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty
+       lines on text-mode terminals.  (bug#7417)
+
 2010-11-17  Stefan Monnier  <address@hidden>
 
        * xterm.c (get_current_wm_state): Rename from get_current_vm_state.

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2010-11-17 02:37:45 +0000
+++ b/src/xdisp.c       2010-11-17 19:15:24 +0000
@@ -12839,6 +12839,15 @@
        && BUFFERP (glyph->object) && glyph->charpos == pt_old)
       && bpos_covered < pt_old)
     {
+      /* An empty line has a single glyph whose OBJECT is zero and
+        whose CHARPOS is the position of a newline on that line.
+        Note that on a TTY, there are more glyphs after that, which
+        were produced by extend_face_to_end_of_line, but their
+        CHARPOS is zero or negative.  */
+      int empty_line_p =
+       (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
+       && INTEGERP (glyph->object) && glyph->charpos > 0;
+
       if (row->ends_in_ellipsis_p && pos_after == last_pos)
        {
          EMACS_INT ellipsis_pos;
@@ -12875,6 +12884,7 @@
               || (row->truncated_on_right_p && pt_old > bpos_max)
               /* Zero-width characters produce no glyphs.  */
               || (!string_seen
+                  && !empty_line_p
                   && (row->reversed_p
                       ? glyph_after > glyphs_end
                       : glyph_after < glyphs_end)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]