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: Eli Zaretskii
Subject: bug#20847: [display engine] 25.0.50; company-mode popup makes point jump to an entirely different location
Date: Sun, 21 Jun 2015 22:23:09 +0300

> Date: Sun, 21 Jun 2015 21:24:39 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 20847@debbugs.gnu.org
> 
> > >> - 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.
> 
> I will see what I can do.

The reason is that there's an invisible property on buffer text.  When
redisplay fails to place the cursor where it belongs, i.e. on the line
that ends with "hel", it looks for alternative strategies.  One of
those is for a use case where point is at the beginning of invisible
text that is before the 1st character displayed in the screen line.
In that case, we put cursor where the invisible text ends.

Of course, the code which handles that was not written for when the
same text also has an overlay string, so it misbehaves.

I can make the code bypass this in the case in point, but the result
will be that cursor will be displayed at the end of the first screen
line, which is hardly better.

So I think we should try telling the display engine where to put the
cursor via the 'cursor' property on buffer text, as proposed earlier.





reply via email to

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