parent
18a9724a83
commit
cf0458e734
|
@ -230,6 +230,11 @@ The following expansions are supported (with required context _in italics_):
|
||||||
contains full-width codepoints (which occupy two columns) or zero-width
|
contains full-width codepoints (which occupy two columns) or zero-width
|
||||||
codepoints
|
codepoints
|
||||||
|
|
||||||
|
*%val{cursor_display_column}*::
|
||||||
|
_in window scope_ +
|
||||||
|
1-based offset from the start of the line to the cursor position in
|
||||||
|
display column, taking into account tabs and character width.
|
||||||
|
|
||||||
*%val{cursor_char_value}*::
|
*%val{cursor_char_value}*::
|
||||||
_in window scope_ +
|
_in window scope_ +
|
||||||
unicode value of the codepoint under the main cursor
|
unicode value of the codepoint under the main cursor
|
||||||
|
|
|
@ -226,6 +226,13 @@ static const EnvVarDesc builtin_env_vars[] = { {
|
||||||
[](StringView name, const Context& context, Quoting quoting) -> String
|
[](StringView name, const Context& context, Quoting quoting) -> String
|
||||||
{ auto coord = context.selections().main().cursor();
|
{ auto coord = context.selections().main().cursor();
|
||||||
return to_string(context.buffer()[coord.line].char_count_to(coord.column) + 1); }
|
return to_string(context.buffer()[coord.line].char_count_to(coord.column) + 1); }
|
||||||
|
}, {
|
||||||
|
"cursor_display_column", false,
|
||||||
|
[](StringView name, const Context& context, Quoting quoting) -> String
|
||||||
|
{ auto coord = context.selections().main().cursor();
|
||||||
|
return to_string(get_column(context.buffer(),
|
||||||
|
context.options()["tabstop"].get<int>(),
|
||||||
|
coord) + 1); }
|
||||||
}, {
|
}, {
|
||||||
"cursor_byte_offset", false,
|
"cursor_byte_offset", false,
|
||||||
[](StringView name, const Context& context, Quoting quoting) -> String
|
[](StringView name, const Context& context, Quoting quoting) -> String
|
||||||
|
|
Loading…
Reference in New Issue
Block a user