From 1dfa2d7fe465a329a09f9ae4130b0f95b2662325 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 19 Apr 2015 15:12:16 +0100 Subject: Avoid unneeded update of selections when we are going to overwrite them --- src/input_handler.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/input_handler.cc') diff --git a/src/input_handler.cc b/src/input_handler.cc index 8b672288..98f2436a 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -60,7 +60,7 @@ struct MouseHandler { m_dragging = true; m_anchor = context.window().buffer_coord(key.mouse_coord()); - context.selections() = SelectionList{ context.buffer(), m_anchor }; + context.selections_write_only() = SelectionList{ context.buffer(), m_anchor }; return true; } if (key.modifiers == Key::Modifiers::MouseRelease) @@ -69,7 +69,7 @@ struct MouseHandler return true; m_dragging = false; auto cursor = context.window().buffer_coord(key.mouse_coord()); - context.selections() = SelectionList{ context.buffer(), Selection{m_anchor, cursor} }; + context.selections_write_only() = SelectionList{ context.buffer(), Selection{m_anchor, cursor} }; return true; } if (key.modifiers == Key::Modifiers::MousePos) @@ -77,7 +77,7 @@ struct MouseHandler if (not m_dragging) return true; auto cursor = context.window().buffer_coord(key.mouse_coord()); - context.selections() = SelectionList{ context.buffer(), Selection{m_anchor, cursor} }; + context.selections_write_only() = SelectionList{ context.buffer(), Selection{m_anchor, cursor} }; return true; } if (key.modifiers == Key::Modifiers::MouseWheelDown) -- cgit v1.2.3