From 91cc8dd8bf25fcef0bafd962b3011c71fdbac18e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 11 Dec 2013 13:46:33 +0000 Subject: Add cursor_char_column env variable --- src/main.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/main.cc b/src/main.cc index e035971a..b1feb55e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -111,6 +111,11 @@ void register_env_vars() "cursor_column", [](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) -- cgit v1.2.3