Do not make cursor visible when not dragging

Fixes #5130
This commit is contained in:
Maxime Coste 2024-03-27 19:07:09 +11:00
parent 610d4114a9
commit 390bff3435

View File

@ -161,7 +161,10 @@ struct MouseHandler
case Key::Modifiers::MouseRelease: { case Key::Modifiers::MouseRelease: {
if (not m_dragging) if (not m_dragging)
{
context.ensure_cursor_visible = false;
return true; return true;
}
auto& selections = context.selections(); auto& selections = context.selections();
cursor = context.window().buffer_coord(key.coord()); cursor = context.window().buffer_coord(key.coord());
selections.main() = {buffer.clamp(m_anchor), cursor}; selections.main() = {buffer.clamp(m_anchor), cursor};
@ -172,7 +175,10 @@ struct MouseHandler
case Key::Modifiers::MousePos: { case Key::Modifiers::MousePos: {
if (not m_dragging) if (not m_dragging)
{
context.ensure_cursor_visible = false;
return true; return true;
}
cursor = context.window().buffer_coord(key.coord()); cursor = context.window().buffer_coord(key.coord());
auto& selections = context.selections(); auto& selections = context.selections();
selections.main() = {buffer.clamp(m_anchor), cursor}; selections.main() = {buffer.clamp(m_anchor), cursor};