summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-03-23 11:32:32 +1100
committerMaxime Coste <mawww@kakoune.org>2019-03-23 11:32:32 +1100
commitcf0458e7348116d9166fd07cc8e008814bf80e05 (patch)
tree2223ba369230201387bb86de0218a719ae00ce02 /src
parent18a9724a833d64f81895b29e652d598f3146b923 (diff)
Add cursor_display_column expansion
Fixes #2788
Diffstat (limited to 'src')
-rw-r--r--src/main.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index 3cd9bc50..8c33629f 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -227,6 +227,13 @@ static const EnvVarDesc builtin_env_vars[] = { {
{ auto coord = context.selections().main().cursor();
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,
[](StringView name, const Context& context, Quoting quoting) -> String
{ auto cursor = context.selections().main().cursor();