diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:12:16 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-04-19 15:12:16 +0100 |
| commit | 1dfa2d7fe465a329a09f9ae4130b0f95b2662325 (patch) | |
| tree | 91a80cc1488132e60ec88a87212b679a2401ac6a /src/input_handler.cc | |
| parent | 9f65a4e6dd735ecdcb4b469b485ff643cd1f54fe (diff) | |
Avoid unneeded update of selections when we are going to overwrite them
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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) |
