Closed merlindiavova closed 1 year ago
buffer.current_pos
should never be nil.
I thought as much, for some reason, when the caret is within the block comments it reports buffer.current_pos
as nil.
I'm using a Linux machine, will check later on my Mac
The current position is the distance in bytes of the caret position from the beginning of the currently viewed document starting with one. So no matter where in the code, the current position is 1 if the Caret is at the very beginning of the buffer or larger, but never nil
.
Try to put following line at the beginning of the file (into the first line):
㑖㑖㑖㑖㑖
and then test which position is reported if you put the caret at the line end (press Ctrl+e and type 'buffer.current_pos` plus Enter. There are five characters behind the caret/cursor but the reported position will be 16 ( 1 + 5*3 bytes for the utf-8 code of the Unicode point of the character).
By the way: you can close the issue clicking on the appropriate button at the bottom of this page as the information provided up to now seem to have solved the problem you were facing.
Thanks @ClaudioGi and @orbitalquark
Hi, Given block comment below, is not normal for the buffer.current_pos to be nil?