cornelis
cornelis copied to clipboard
Investigate using line2byte for highlighting
Allegedly line2byte
in vim does the line offsetting that we'd like.
Also, the byteidx
function seems to do the right translation given a string. Furthermore, byte2line
is almost exactly the buffer lookup we want.
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
.