[Top][All Lists]

[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 16:30:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0

On 06/19/2015 10:07 PM, Eli Zaretskii wrote:

Hi Eli,

sorry for the late reply.

  . There's no 'cursor' property on the overlay string that Company
    creates for its "tooltip" of completions.  Or at least I couldn't
    find that property: I tried both "M-x describe-text-properties" and
    looking at the overlay string in GDB -- I see no 'cursor' property,
    certainly not on the newline that starts the string.  If indeed
    there is such a property there, please tell how to see it.

I'm sorry, my memory of that code was unclear. `cursor' is currently used only under certain rare condition, but see the end of `company--replacement-string', where it's applied.

Even if remove the "when" condition to put it on all the time, the behavior doesn't change.

By the way, since we're now discussing the changes to Company code, let's use the master version from address@hidden:company-mode/company-mode.git. Thus, the scenario changes from installing it from ELPA, to cloning the repo, adding the dir to `load-path' and `(require 'company)'.

  . In any case, you cannot put the 'cursor' property on a newline and
    hope it to work: the newline doesn't leave any glyphs on display,
    certainly not when the cursor is displayed on the fringe.  So the
    display engine doesn't know you've put the 'cursor' property there.

Which character should I put this property on in this situation, then?

The other odd thing is that the cursor is displayed in the margin opposite the last completion (there are 2 or 3 of them), but the overlay is actually of fixed size (10). So the cursor margin position doesn't correspond to the value of point, nor either of the overlay bounds.

  . The overlay string generated by Company in this case is
    problematic: it puts a newline at the end of each screen line, and
    that removes the last character of each screen line from display.
    I don't understand why you need to insert newlines when the
    original text lines were one long continued line.  This is a bug in

It's a workaround I felt forced to take for the bug#18285. Since you've vetoed my suggestion to prioritize `invisible' over `display', the natural solution is to generally start the overlay a bit earlier.

It also simplifies some logic in the code, because sometimes we have to do this anyway (when the popup is displayed below the last line, and it has no trailing newline). Although this reason is less important.

idea why Company's post-command-hook calls sit-for, thus forcing

The current Company master has no `sit-for' calls, but both problems are still there.

reply via email to

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