cornelis icon indicating copy to clipboard operation
cornelis copied to clipboard

Investigate using line2byte for highlighting

Open isovector opened this issue 2 years ago • 2 comments

Allegedly line2byte in vim does the line offsetting that we'd like.

isovector avatar Feb 01 '22 17:02 isovector

Also, the byteidx function seems to do the right translation given a string. Furthermore, byte2line is almost exactly the buffer lookup we want.

isovector avatar Feb 18 '22 03:02 isovector

I think the technique here is to use byte2line to get the line, call line2byte on that, subtract the two to get the line offset, and then use byteidx on that to get the actual BufferOffset.

isovector avatar Feb 18 '22 03:02 isovector