emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107709: Fix cursor positioning in ro


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107709: Fix cursor positioning in rows completely covered by display strings.
Date: Sat, 31 Mar 2012 10:45:33 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107709
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2012-03-31 10:45:33 +0300
message:
  Fix cursor positioning in rows completely covered by display strings.
  
   src/xdisp.c (set_cursor_from_row): If `cursor' property on a display
   string comes from a `display' text property, use the buffer
   position of that property as if we actually saw that position in
   the row's glyphs.
modified:
  lisp/dired.el
  src/ChangeLog
  src/xdisp.c
=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2012-03-30 16:49:29 +0000
+++ b/lisp/dired.el     2012-03-31 07:45:33 +0000
@@ -3736,7 +3736,7 @@
 ;;;;;;  dired-run-shell-command dired-do-shell-command 
dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories 
dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"aefbe886cce7b5436fd41a7c55c86f84")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"a07cca6379bd3fdc9eaeba4d341b89ee")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-03-30 08:45:27 +0000
+++ b/src/ChangeLog     2012-03-31 07:45:33 +0000
@@ -1,3 +1,10 @@
+2012-03-31  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (set_cursor_from_row): If `cursor' property on a display
+       string comes from a `display' text property, use the buffer
+       position of that property as if we actually saw that position in
+       the row's glyphs.
+
 2012-03-30  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (append_space_for_newline): If the default face was

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-03-30 08:45:27 +0000
+++ b/src/xdisp.c       2012-03-31 07:45:33 +0000
@@ -13800,16 +13800,31 @@
 
            chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
                                         glyph->object);
+           if (!NILP (chprop))
+             {
+               /* If the string came from a `display' text property,
+                  look up the buffer position of that property and
+                  use that position to update bpos_max, as if we
+                  actually saw such a position in one of the row's
+                  glyphs.  This helps with supporting integer values
+                  of `cursor' property on the display string in
+                  situations where most or all of the row's buffer
+                  text is completely covered by display properties,
+                  so that no glyph with valid buffer positions is
+                  ever seen in the row.  */
+               EMACS_INT prop_pos =
+                 string_buffer_position_lim (glyph->object, pos_before,
+                                             pos_after, 0);
+
+               if (prop_pos >= pos_before)
+                 bpos_max = prop_pos - 1;
+             }
            if (INTEGERP (chprop))
              {
                bpos_covered = bpos_max + XINT (chprop);
                /* If the `cursor' property covers buffer positions up
                   to and including point, we should display cursor on
-                  this glyph.  Note that overlays and text properties
-                  with string values stop bidi reordering, so every
-                  buffer position to the left of the string is always
-                  smaller than any position to the right of the
-                  string.  Therefore, if a `cursor' property on one
+                  this glyph.  Note that, if a `cursor' property on one
                   of the string's characters has an integer value, we
                   will break out of the loop below _before_ we get to
                   the position match above.  IOW, integer values of
@@ -13869,6 +13884,15 @@
 
            chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
                                         glyph->object);
+           if (!NILP (chprop))
+             {
+               EMACS_INT prop_pos =
+                 string_buffer_position_lim (glyph->object, pos_before,
+                                             pos_after, 0);
+
+               if (prop_pos >= pos_before)
+                 bpos_max = prop_pos - 1;
+             }
            if (INTEGERP (chprop))
              {
                bpos_covered = bpos_max + XINT (chprop);


reply via email to

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