src: Add a window_range
default expansion
This commit adds a `window_range` default expansion that holds the coordinates and size of the buffer-space on the window. Fixes #675
This commit is contained in:
parent
3c34de7fe7
commit
c744b59f7d
11
src/main.cc
11
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user