emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Darius Foo <darius.foo.tw@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] org-indent and display text property not preserving column when moving
Date: Thu, 16 Feb 2023 11:30:00 +0800	[thread overview]
Message-ID: <CAKBp_ChoE37FQBpvN=+nELV7cHPhNkLtYLRn2Y3FxwZenXXLEw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

Hi, I've encountered what seems like a bug with org-indent. When I move the
cursor using the arrow keys on lines with the display text property set,
its column isn't preserved, jumping ahead or back by a fixed amount.

This issue actually came up with org-modern, but I'm minimized it to the
following.

    (use-package org
      :mode (("\\.org$" . org-mode))
      :custom
      (org-startup-indented t)
      :config
      (font-lock-add-keywords 'org-mode '(("^\\(-\\)\\( \\)" 1 '(face nil
display "•")))))

Here is an org file to try it on. With the cursor on x, pressing up moves
it to y instead of a, and pressing down moves it back to x. It seems like
the amount moved depends on the indentation added by org-indent: with point
on z, pressing up moves it to w.

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

Thanks.
Darius

Emacs  : GNU Emacs 28.2 (build 2, x86_64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.5.1 (Build 21G83))
 of 2023-01-06
Package: Org mode version 9.6.1 (9.6.1-g74eb0f @
/Users/darius/.emacs.d/straight/build/org/)

[-- Attachment #2: Type: text/html, Size: 1343 bytes --]

             reply	other threads:[~2023-02-16 15:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16  3:30 Darius Foo [this message]
2023-02-17 11:18 ` [BUG] org-indent and display text property not preserving column when moving Ihor Radchenko
2023-02-17 16:28   ` Darius Foo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKBp_ChoE37FQBpvN=+nELV7cHPhNkLtYLRn2Y3FxwZenXXLEw@mail.gmail.com' \
    --to=darius.foo.tw@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).