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: Tue, 23 Jun 2015 19:39:55 +0300

> Cc: address@hidden
> From: Dmitry Gutov <address@hidden>
> Date: Tue, 23 Jun 2015 00:06:06 +0300
> 
> On 06/22/2015 07:26 PM, Eli Zaretskii wrote:
> 
> >> This doesn't seem to have any effect, though. Adding
> >>
> >>         (when (eq ?\n (char-after (overlay-start ov)))
> >>           (let ((inhibit-modification-hooks t))
> >>             (put-text-property (overlay-start ov) (1+ (overlay-start ov))
> >> 'cursor t)))
> >>
> >> to the end of company-pseudo-tooltip-unhide creates no change in the
> >> behavior.
> >
> > That's because I have yet to write the code to support that ;-)
> 
> I'm not sure I like that idea. If I have to write a workaround (this 
> definitely feels like it), I'd rather write a workaround that will work 
> in the current Emacs releases too. (If I manage to, of course).

Would it be possible in this specific case to start the overlay from
the next line, i.e. leave the newline alone?  I think if you do that,
things ought to work without any changes.  Since the "tooltip" pops up
below this line, it seems to me that the newline which begins the
overlay now is not needed, is it?

> And supporting `cursor' on buffer text newline but not on overlay 
> display string newline feels like adding a yet-another edge case.

It's indeed a kludge.  I just didn't have any other ideas.

> Going back to your earlier message, I'm actually not sure I agree with this:
> 
>  > Any scenario where a screen line ends in a newline that comes from an
>  > overlay string [performs better under the current behavior].  Try
>  > several such scenarios, and then tell me whether
>  > the place we display the cursor looks better than the alternative.
> 
> The current example shows that it's better to display the cursor on the 
> margin, rather than after the overlay. What are the examples where this 
> is not true?

All the others ;-)

> Are those cases where the said newline is not at the beginning of
> the overlay?

No, I think what makes this case special is the fact that (the visible
part of) the overlay begins on the line below the one where the user
types.  So from the user POV, the current line is still occupied only
by buffer text, and so users will expect the cursor to be displayed as
if there were no overlay at all.

By contrast, the "usual" case with overlays that span multiple lines
is that the situation with positioning the cursor arises when some of
the overlay string is visible on the current line, and then the user
expectation is to see the cursor after the string.  That's what the
code which handles this situation tries to make happen.

> Even if cursor would look weird in some case, at least point is not 
> forcibly moved to a different position.

We are in agreement regarding the best place of showing the cursor in
this case.  The only problem is how to do that.





reply via email to

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