Cursor location offset from true location

39 views
Skip to first unread message

Jean Lalonde

unread,
May 20, 2025, 5:06:05 PMMay 20
to scintilla-interest
Hi,

A user of my app containing th Scintilla editor component (DLL v3.7.6) reports the following error:

The cursor while in Editor almost always will be offset from its true location. It makes it difficult to edit text since you don't know where you are within the text. The attached image shows the cursor to the left of the period while the true location is at the end of the line. So if I were to press the delete key, it wouldn't delete the period but instead move the next line up to the end of the current line. The cursor can be 1 or 2 positions offset and it might have been to 3 before. This makes it more difficult to edit since it's not consistent and you can't account for it.

Only one user reported the error. He is using Windows 11. I can't reproduce the issue on my dev and test systems (Win10 and 11) with various resolutions and scalings.

Have you ever seen this issue with other implementations of Scintilla? What should I investigate to locate the source of this issue?

Thanks you for the great help found from this group's users!

Jean


Mitchell

unread,
May 20, 2025, 5:21:39 PMMay 20
to scintilla...@googlegroups.com
Hi,
I have seen this happen with weird fonts. I don’t remember which ones, but changing the font made the problem go away for me. Your suggestion of using a fixed width font was a good one.

Cheers,
Mitchell

>
> Thanks you for the great help found from this group's users!
>
> Jean
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-inter...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/b33e304a-68b5-4e7e-86c5-c70e83c3c4b2n%40googlegroups.com.

Neil

unread,
May 20, 2025, 6:40:46 PMMay 20
to scintilla-interest
I can't see the image as the thumbnail is too small and I don't have permission to view the image directly. There is also no example file to check.

Scaling is a likely issue as is remote viewing. There may be different results with GDI versus DirectWrite. Unusual characters like (right-to-left) Arabic can show up as wrongly positioned carets.

This is an old version of Scintilla so a newer version may not show the problem.

Neil

Jean Lalonde

unread,
May 21, 2025, 5:22:31 PMMay 21
to scintilla-interest
Hi Neil,

Here is the image you could not see on the forum without an account.

I'll upgrade to Scintilla v5.5.6. Just to make sure, if I compare this release with v3.7.6 I'm currently using, the differences are:

- new name of the DLL Scintilla.dll (was SciLexer.dll)
- the lexing commands were removed from Scintilla.dll  (moved to Lexilla.dll)

If I don't use lexing commands, the AHK wrapper I use to send messages to SciLexer v3.7.6 should work as-is with Scintilla.dll. And I should have no other change to do in my code.

For the history, I tried to implement language lexing in my editor. I did it using v3.7.6 because I do not have an AHK wrapper for Lexilla.DLL. At this time, writing a AHK wrapper for it is beyond my knowledge level. I may do it later with help from AHK forum users. But I also had challenges understanding how to implement lexing. So I decided to put these two learning curves further down my roadmap.

Thanks for your help,
Jean

Neil Hodgson

unread,
May 21, 2025, 6:33:45 PMMay 21
to scintilla...@googlegroups.com
Jean Lalonde:

> Here is the image you could not see on the forum without an account.

That appears to be common ASCII text so unlikely to be triggering
previously seen problems.

A clue may be whether the problem occurs on the initial display line
of a wrapped line or only on subsequent lines. Scintilla relies on
character positioning remaining the same between measuring the line as
a whole and displaying the portions that make up each display line.

Neil

Jean Lalonde

unread,
May 22, 2025, 3:40:59 PMMay 22
to scintilla-interest
Thank you Neil. I forwarded your question to the user. I'll follow when he responds.

Please, could you confirm if my understanding is OK?

> If I don't use lexing commands, the AHK wrapper I use to send messages to SciLexer v3.7.6 should work as-is with Scintilla.dll. And I should have no other change to do in my code.

Jean

Neil Hodgson

unread,
May 22, 2025, 5:41:48 PMMay 22
to scintilla...@googlegroups.com
Jean Lalonde:

> > If I don't use lexing commands, the AHK wrapper I use to send messages to SciLexer v3.7.6 should work as-is with Scintilla.dll. And I should have no other change to do in my code.

I have no experience with the AHK wrapper. There may be some
incompatibilities between Scintilla 3.7.6 and 5.x but most APIs
remained consistent.

Neil

Jean Lalonde

unread,
May 23, 2025, 10:28:34 AMMay 23
to scintilla-interest
I implemented Scintilla v5.  So far, so good.  All I had to change was the file name of the DLL when loading Scintilla. Thanks you Neil.

For AHK developers looking for this wrapper, it is here (only updated for v5 in the "beta" branch at this time):

Jean

Reply all
Reply to author
Forward
0 new messages