-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Improve unicode string handling in linkifier #1678
Conversation
Ready for review 😸 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work, the review is mainly clean up/strictness related stuff
@Tyriar I think I have addressed all review issues. Up for the next round 😸 Could you also test the issue from #1669 (comment) again? I think it is not related to the linkifier at all and will need separate tracking before closing the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I checked 3.4.0 and #1669 (comment) doesn't appear to be a regression
Had to do several changes to get the cell/length offset mess working. This PR shall fix #1669.
Changes in
Buffer.ts
:BufferStringIterator
: class to get a hold of the buffer string content in a convenient wayBuffer.stringIndexToBufferIndex
: method to translate a string index from a string retrieved byBuffer.translateBufferLineToString
to get the row and cols indices in the buffer. Atm this method assumes that the string started at col 0.(Can be changed easily to respectstartCol
as well.)Buffer.contents
: return aBufferStringIterator
Changes in
Linkifier.ts
:_linkifyRow
and_doLinkifyRow
TODO:
Linkifier._addLink
to support unicode char offsets within a match (currently only pre/post match offsets are respected)@alexr00 The new methods inBuffer
can also fix the highlight offset problems of the selection manager. Might be worth a look once this PR can land.Seems to work now.issue created #1680 + #1686