Use last display setup instead of recomputing for window_range
Fixes #4964
This commit is contained in:
parent
9b1f4f5f20
commit
9787756619
|
@ -385,7 +385,7 @@ static const EnvVarDesc builtin_env_vars[] = { {
|
||||||
"window_range", false,
|
"window_range", false,
|
||||||
[](StringView name, const Context& context) -> Vector<String>
|
[](StringView name, const Context& context) -> Vector<String>
|
||||||
{
|
{
|
||||||
auto setup = context.window().compute_display_setup(context);
|
const auto& setup = context.window().last_display_setup();
|
||||||
return {format("{} {} {} {}", setup.first_line, setup.first_column,
|
return {format("{} {} {} {}", setup.first_line, setup.first_column,
|
||||||
setup.line_count, 0)};
|
setup.line_count, 0)};
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,7 @@ const DisplayBuffer& Window::update_display_buffer(const Context& context)
|
||||||
|
|
||||||
set_position({setup.first_line, setup.first_column});
|
set_position({setup.first_line, setup.first_column});
|
||||||
m_last_setup = build_setup(context);
|
m_last_setup = build_setup(context);
|
||||||
|
m_last_display_setup = setup;
|
||||||
|
|
||||||
return m_display_buffer;
|
return m_display_buffer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,10 +49,12 @@ public:
|
||||||
void clear_display_buffer();
|
void clear_display_buffer();
|
||||||
void run_resize_hook_ifn();
|
void run_resize_hook_ifn();
|
||||||
|
|
||||||
DisplaySetup compute_display_setup(const Context& context) const;
|
const DisplaySetup& last_display_setup() const { return m_last_display_setup; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Window(const Window&) = delete;
|
Window(const Window&) = delete;
|
||||||
|
|
||||||
|
DisplaySetup compute_display_setup(const Context& context) const;
|
||||||
void on_option_changed(const Option& option) override;
|
void on_option_changed(const Option& option) override;
|
||||||
|
|
||||||
friend class ClientManager;
|
friend class ClientManager;
|
||||||
|
@ -68,6 +70,7 @@ private:
|
||||||
|
|
||||||
Highlighters m_builtin_highlighters;
|
Highlighters m_builtin_highlighters;
|
||||||
bool m_resize_hook_pending = false;
|
bool m_resize_hook_pending = false;
|
||||||
|
DisplaySetup m_last_display_setup;
|
||||||
|
|
||||||
struct Setup
|
struct Setup
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user