summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-12-11 13:46:33 +0000
committerMaxime Coste <frrrwww@gmail.com>2013-12-11 13:46:33 +0000
commit91cc8dd8bf25fcef0bafd962b3011c71fdbac18e (patch)
tree26101c60ad86ec7722f50c7be3e0644c8023160e /src
parentf0c336a28355a95d48c91dd762c00742511fb34e (diff)
Add cursor_char_column env variable
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();