diff --git a/src/main.cc b/src/main.cc index 5cc39286..9c3b4287 100644 --- a/src/main.cc +++ b/src/main.cc @@ -280,6 +280,17 @@ static const EnvVarDesc builtin_env_vars[] = { { "user_modes", false, [](StringView name, const Context& context, Quoting quoting) -> String { return join(context.keymaps().user_modes(), ' ', false); } + }, { + "window_range", false, + [](StringView name, const Context& context, Quoting quoting) -> String + { + const auto top_left = context.window().display_position({0, 0}); + const auto window_dim = context.window().dimensions(); + + return format("{} {} {} {}", top_left->line, top_left->column, + window_dim.line - top_left->line, + window_dim.column - top_left->column); + } } };