Subject: Re: bug#61361: cursor cannot be at the start of overlay that starts with a newline

From: Dmitry Gutov <[email-masked]>
Date: Wed, 8 Feb 2023 17:16:40 +0200

On 08/02/2023 17:09, Eli Zaretskii wrote:
>> From: Xinyang Chen<[email-masked]>
>> Date: Wed, 8 Feb 2023 09:25:07 -0500
>>
>> I'm not seeing the point here though; what happens if you have a line with a single newline? What allows
>> placing a cursor there in that case?
> In that case, Emacs_knows_  that point is positioned at the newline,
> so it does an extra-special trick of placing the cursor after the last
> character of the line.
> 
> But the 'cursor' property just supplies the index in the display
> string where your Lisp program wants to place the cursor.  Emacs
> cannot place point inside a display string.  So the display engine
> needs to find where that index is on display.  And it cannot find that
> place because there's no glyph that corresponds to the newline.

So, no chance of the display engine detecting that the same display 
string with the 'cursor' property has a newline at that position?

That's unfortunate: that means we'll need to create some wonky 
workaround for displaying a completion preview (in Company) when a 
completion starts with a newline.