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

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

bug#20847: [display engine] 25.0.50; company-mode popup makes point jump


From: Dmitry Gutov
Subject: bug#20847: [display engine] 25.0.50; company-mode popup makes point jump to an entirely different location
Date: Sun, 21 Jun 2015 21:06:07 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0

On 06/21/2015 07:43 PM, Eli Zaretskii wrote:

Any scenario where a screen line ends in a newline that comes from an
overlay string.  Try several such scenarios, and then tell me whether
the place we display the cursor looks better than the alternative.

Hmm, yeah, after sounds better that before. But we do display point in the margin on step 6. So it must be possible.

Emacs cannot move cursor except by moving point, I'm sure you know
that.  The only exception is when we show the cursor on a display or
overlay string, guided by the 'cursor' property.  There are no other
exceptions.

Not really. I only know that *I* can't move cursor by any other means.

I also vaguely recall someone (yourself?) stating that this limitation could be lifted without too much work.

See the bottom of `company--replacement-string'. If `cursor' is applied
unconditionally, and if I change the arguments 0 and 1 to 1 and 2, on
step 6 the cursor is displayed at the beginning of the next line (so we
know the change has effect), but the second problem (after step 9) is
still present.

AFAICT, this will put the 'cursor' property on a character that is
after the leading newline of the overlay string, yes?

True.

If so, that's
not going to work: you need th 'cursor' property on some glyph that is
displayed on the same line where the newline is.

Augh.

Like mentioned in the previous message, I don't see a good, non-user-confusing place for it on the same line. The beginning of the next line would've worked reasonably well, though.

I'd also accept the cursor not being displayed at all.

> That is, you need to
make at least one character of "hel" part of the overlay string, and
put the 'cursor' property on it, making its value large enough to
"cover" the position of the newline.

I was kinda hoping that "overlay with display string starting with newline" was the only issue.

- The bug only manifests after the step 9 (backspacing), whereas the
whole explanation seems to apply to the step 6 as well. Yet, point stays
in place there.

Like I said, I didn't investigate that.  I think some redisplay
optimization is responsible.  If it's important to have the same
(mis)behavior in both cases, I can look into that.

Couldn't the same optimization have a reason to be enabled in both cases? It might be worth investigating, at least.

Consistent behavior would also be good; so that the users don't have to try too hard to catch problematic cases like this one.

The bidirectional display doesn't have that
luxury, so it needs additional support information, and that
information is simply absent in this case.

I see.





reply via email to

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