diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-11 13:46:33 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-11 13:46:33 +0000 |
| commit | 91cc8dd8bf25fcef0bafd962b3011c71fdbac18e (patch) | |
| tree | 26101c60ad86ec7722f50c7be3e0644c8023160e /src | |
| parent | f0c336a28355a95d48c91dd762c00742511fb34e (diff) | |
Add cursor_char_column env variable
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 5 |
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(); |
