Merge remote-tracking branch 'Screwtapello/ranges-use-bytes'

This commit is contained in:
Maxime Coste 2018-10-14 09:29:38 +11:00
commit 596bed3f36
2 changed files with 25 additions and 14 deletions

View File

@ -199,8 +199,10 @@ The following expansions are supported (with required context _in italics_):
*%val{cursor_char_column}*:: *%val{cursor_char_column}*::
_in window scope_ + _in window scope_ +
column of the main cursor (in characters), the fourth component of 1-based offset from the start of the line to the cursor position in
`%val{selection_desc}` Unicode codepoints, which may differ from visible columns if the document
contains full-width codepoints (which occupy two columns) or zero-width
codepoints
*%val{cursor_char_value}*:: *%val{cursor_char_value}*::
_in window scope_ + _in window scope_ +
@ -208,7 +210,9 @@ The following expansions are supported (with required context _in italics_):
*%val{cursor_column}*:: *%val{cursor_column}*::
_in window scope_ + _in window scope_ +
column of the main cursor (in bytes) 1-based offset from the start of the line to the first byte of the
character under the main cursor (in bytes), the fourth component of
`%val{selection_desc}`
*%val{cursor_line}*:: *%val{cursor_line}*::
_in window scope_ + _in window scope_ +
@ -250,10 +254,11 @@ The following expansions are supported (with required context _in italics_):
*%val{selection_desc}*:: *%val{selection_desc}*::
_in window scope_ + _in window scope_ +
range of the main selection, represented as `a.b,c.d` where _a_ range of the main selection, represented as `a.b,c.d` where _a_ is the
is the anchor line, _b_ is the anchor column, _c_ is the cursor anchor line, _b_ is the number of bytes from the start of the line to the
line (like `%val{cursor_line}`), _d_ is the cursor column (like anchor, _c_ is the cursor line (like `%val{cursor_line}`), _d_ is
`%val{cursor_char_column}`), and all are 1-based decimal integers the number of bytes from the start of the line to the cursor (like
`%val{cursor_column}`), and all are 1-based decimal integers
*%val{selections_desc}*:: *%val{selections_desc}*::
_in window scope_ + _in window scope_ +

View File

@ -86,13 +86,19 @@ are exclusively available to built-in options.
`declare-option`. `declare-option`.
*range-specs*:: *range-specs*::
a list of a pair of a buffer range (`<begin line>.<begin column>, a timestamp (like `%val{timestamp}`,
<end line>.<end column>` or `<begin line>.<begin column>+<length>`) see <<expansions#value-expansions,`:doc expansions value-expansions`>>)
and a string (separated by `|`), except for the first element which followed by a list of range descriptors. Each range descriptor must use
is just the timestamp of the buffer. When the `update-option` is the syntax `a.b,c.d|string` or `a.b+length|string`, where _a_ is the line
used on an option of this type, its ranges gets updated according containing the first character, _b_ is the number of bytes from the start
to all the buffer modifications that happened since its timestamp. of the line to the first byte of the first character, _c_ is the line
See <<highlighters#specs-highlighters,`:doc highlighters specs-highlighters`>>) containing the last character, _d_ is the number of bytes from the start of
the line to the first byte of the last character, _length_ is the length of
the range in bytes and _string_ is an arbitrary string which is associated
with the range. All numeric fields are 1-based. When the `update-option` is
used on an option of this type, its ranges gets updated according to all the
buffer modifications that happened since its timestamp. See
<<highlighters#specs-highlighters,`:doc highlighters specs-highlighters`>>)
`set -add` appends the new pair to the list `set -add` appends the new pair to the list
*line-specs*:: *line-specs*::