summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index e035971a..b1feb55e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -112,6 +112,11 @@ void register_env_vars()
[](const String& name, const Context& context)
{ return to_string(context.editor().main_selection().last().column + 1); }
}, {
+ "cursor_char_column",
+ [](const String& name, const Context& context)
+ { auto coord = context.editor().main_selection().last();
+ return to_string(context.buffer()[coord.line].char_count_to(coord.column) + 1); }
+ }, {
"selection_desc",
[](const String& name, const Context& context)
{ auto& sel = context.editor().main_selection();