diff --git a/src/context.hh b/src/context.hh index 5ef3c42c..3fe28dc2 100644 --- a/src/context.hh +++ b/src/context.hh @@ -117,7 +117,6 @@ public: bool is_editing() const { return m_edition_level!= 0; } void disable_undo_handling() { m_edition_level = -1; } - bool is_editing_selection() const { return m_selection_history.in_edition(); } NestedBool& hooks_disabled() { return m_hooks_disabled; } const NestedBool& hooks_disabled() const { return m_hooks_disabled; } diff --git a/src/input_handler.cc b/src/input_handler.cc index f90d2d22..664490d6 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -100,7 +100,6 @@ struct MouseHandler switch (key.mouse_button()) { case Key::MouseButton::Right: { - kak_assert(not context.is_editing_selection()); m_dragging.reset(); cursor = context.window().buffer_coord(key.coord()); ScopedSelectionEdition selection_edition{context}; @@ -114,7 +113,6 @@ struct MouseHandler } case Key::MouseButton::Left: { - kak_assert(not context.is_editing_selection()); m_dragging.reset(new ScopedSelectionEdition{context}); m_anchor = context.window().buffer_coord(key.coord()); if (not (key.modifiers & Key::Modifiers::Control)) diff --git a/test/regression/0-mouse-during-insert/cmd b/test/regression/0-mouse-during-insert/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/regression/0-mouse-during-insert/cmd @@ -0,0 +1 @@ + diff --git a/test/regression/0-mouse-during-insert/in b/test/regression/0-mouse-during-insert/in new file mode 100644 index 00000000..190a1803 --- /dev/null +++ b/test/regression/0-mouse-during-insert/in @@ -0,0 +1 @@ +123 diff --git a/test/regression/0-mouse-during-insert/out b/test/regression/0-mouse-during-insert/out new file mode 100644 index 00000000..547b8306 --- /dev/null +++ b/test/regression/0-mouse-during-insert/out @@ -0,0 +1 @@ +a1b2c3 diff --git a/test/regression/0-mouse-during-insert/script b/test/regression/0-mouse-during-insert/script new file mode 100644 index 00000000..aaf225ce --- /dev/null +++ b/test/regression/0-mouse-during-insert/script @@ -0,0 +1,11 @@ +ui_out -ignore 4 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "a" ] }' +sleep .1 +ui_in '{ "jsonrpc": "2.0", "method": "mouse_press", "params": [ "left", 0, 2 ] }' +sleep .1 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "b" ] }' +sleep .1 +ui_in '{ "jsonrpc": "2.0", "method": "mouse_release", "params": [ "left", 0, 4 ] }' +sleep .1 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "c" ] }'