help-gnu-emacs
[Top][All Lists]
Advanced

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

Moving point around empty overlays with 'after-text


From: Ash
Subject: Moving point around empty overlays with 'after-text
Date: Fri, 07 Apr 2023 22:46:19 -0700
User-agent: Cyrus-JMAP/3.9.0-alpha0-334-g8c072af647-fm-20230330.001-g8c072af6

https://github.com/emacs-lsp/lsp-mode/issues/3263 is a bug in lsp-mode (emacs's
own eglot has the same bug as far as I can tell) that appears to boil down to
the behavior of emacs overlays and after-string. That is, if your buffer looks
like

let my_value{: Vec<i32>} = vec![0, 1, 2];

(where the curly braces indicate the after-string property of an
overlay), you need to put your cursor *after* the overlay to
insert text at the end of the variable name, which comes *before*
it, and it's impossible to put your cursor immediately between
the overlay and the preceding text. I assume the behavior the
user desires is that you can put your cursor either immediately
before or immediately after the overlay and insert text, and that
pressing the left/right arrow would move you over the overlay but
leave the actual position of point unchahnged.

My suspicion is that this isn't fixable just by setting the right text/overlay
properties, since both the cursor locations immediately before and after the
overlay actually correspond to the same location in the underlying string. But
I'm not good at text property arcana. Any advice?


reply via email to

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