Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emoji characters cause issues such as offset to search highlighting as well as hyperlink anomalies #45

Closed
floufleobli opened this issue Mar 23, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@floufleobli
Copy link

floufleobli commented Mar 23, 2017

(for what it's worth, testing shows this issue does not affect gnote ...)

emoji characters (e.g. 😁) inserted into a tomboy note cause search highlighting to be offset for matches appearing somewhere after the emoji character. for example, say you have a note with the following content:

test1
😁
test2

if you search for "test", the string "test" will be highlighted in the first line, whereas the string "est2" will be highlighted in the third line.

emoji characters also cause anomalies in hyperlinking. after inserting e.g. "😁" into a note, if you type "http://google.com" somewhere after the emoji, once you type "http://", the text will appear as a hyperlink, but once you type "g" the leading "h" will no longer appear as part of the hyperlink; once you type "o", the leading "h" will again appear as part of the hyperlink (this alternation continues as you continue to type).

Note that I originally assumed that all multibyte characters cause this issue, but that doesn't seem to be the case, as the ellipsis character (…), as an example, doesn't cause the same issue.

@alex-ter
Copy link
Member

Sounds like a bug to me, thanks for reporting.

@alex-ter
Copy link
Member

alex-ter commented Apr 8, 2017

So apparently this is buffer.GetSlice() at line 1230 of NoteWindow.c returning two question marks instead of one symbol when it has such a symbol and that screws further indexing. I haven't yet found what exactly is causing this, but I'm looking into this.

@alex-ter alex-ter self-assigned this Apr 8, 2017
alex-ter added a commit that referenced this issue May 27, 2017
Closes #45.

Signed-off-by: Alex Tereschenko <frozen.and.blue@gmail.com>
alex-ter added a commit that referenced this issue May 27, 2017
Closes #45.

Signed-off-by: Alex Tereschenko <frozen.and.blue@gmail.com>
alex-ter added a commit that referenced this issue May 27, 2017
Closes #45.

Signed-off-by: Alex Tereschenko <frozen.and.blue@gmail.com>
alex-ter added a commit that referenced this issue May 27, 2017
Closes #45.

Signed-off-by: Alex Tereschenko <frozen.and.blue@gmail.com>
@alex-ter
Copy link
Member

So at the end of the day it turned out a slightly different problem and actually even two (with the same root cause). Both search highlighting and URL activation were using .NET's string indexes, which apparently are not covering all Unicode symbols as symbols and fall back to bytes for things like these emojis.

I've fixed both places to use a different approach to determining the area to highlight/activate and it passed my simple tests, so I've got this in. Feel free to test it out and let me know if you'd want an engineering build for Windows to give it a try.

@alex-ter alex-ter added this to the 1.15.9 milestone May 27, 2017
@floufleobli
Copy link
Author

thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants