GNU bug report logs - #61580
line-prefix and display text properties cause odd cursor movement

Previous Next

Package: emacs;

Reported by: Darius Foo <darius.foo.tw <at> gmail.com>

Date: Fri, 17 Feb 2023 17:15:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Darius Foo <darius.foo.tw <at> gmail.com>
To: 61580 <at> debbugs.gnu.org
Subject: bug#61580: line-prefix and display text properties cause odd cursor movement
Date: Sat, 18 Feb 2023 00:39:00 +0800
[Message part 1 (text/plain, inline)]
When moving the cursor up and down on lines which have both line-prefix and
display text properties, the cursor column isn't preserved, jumping ahead
or back by a fixed amount.

This can be reproduced with the following config

      (add-text-properties 12 13 '(line-prefix "  "))
      (add-text-properties 27 28 '(line-prefix "  "))
      (add-text-properties 57 58 '(line-prefix "    "))
      (add-text-properties 72 73 '(line-prefix "    "))

      (add-text-properties 12 13 '(display "•"))
      (add-text-properties 27 28 '(display "•"))
      (add-text-properties 57 58 '(display "•"))
      (add-text-properties 72 73 '(display "•"))

and this input file (which mimics org-indent).

    * h1
    ** h2
    - a.y.........
    - x...........
    *** h3
    **** h4
    - ....w.......
    - z...........

With the cursor on x, pressing up moves it to y instead of a, and pressing
down moves it back to x. The amount moved depends on the indentation added
by line-prefix: with the cursor on z, pressing up moves it to w.
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.