From f7038980a0aa88821b0be4858818936637c96e69 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 21 Jan 2013 13:58:54 +0100 Subject: [PATCH] Add kak_cursor_{line,column} env var --- src/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cc b/src/main.cc index cc87a401..269f4e5b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -648,6 +648,12 @@ void register_env_vars() shell_manager.register_env_var("client", [](const String& name, const Context& context) { return ClientManager::instance().get_client_name(context); }); + shell_manager.register_env_var("cursor_line", + [](const String& name, const Context& context) + { return int_to_str((int)context.editor().selections().back().last().line() + 1); }); + shell_manager.register_env_var("cursor_column", + [](const String& name, const Context& context) + { return int_to_str((int)context.editor().selections().back().last().column() + 1); }); } void register_registers()