mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibVT: Add movemouse support for triple click
When moving the mouse after a triple click, the selected buffer does not maintain the whole line selection. This patch will allow triple click highlighting to hold the whole line selection.
This commit is contained in:
parent
7a673f5aa3
commit
b5f812d11d
1 changed files with 15 additions and 2 deletions
|
@ -869,8 +869,21 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
m_auto_scroll_direction = AutoScrollDirection::None;
|
||||
|
||||
VT::Position old_selection_end = m_selection.end();
|
||||
m_selection.set_end(position);
|
||||
if (old_selection_end != m_selection.end()) {
|
||||
VT::Position old_selection_start = m_selection.start();
|
||||
|
||||
if (m_triple_click_timer.is_valid()) {
|
||||
int start_column = 0;
|
||||
int end_column = m_terminal.columns() - 1;
|
||||
|
||||
if (position.row() < m_left_mousedown_position_buffer.row())
|
||||
m_selection.set({ position.row(), start_column }, { m_left_mousedown_position_buffer.row(), end_column });
|
||||
else
|
||||
m_selection.set({ m_left_mousedown_position_buffer.row(), start_column }, { position.row(), end_column });
|
||||
} else {
|
||||
m_selection.set_end(position);
|
||||
}
|
||||
|
||||
if (old_selection_end != m_selection.end() || old_selection_start != m_selection.start()) {
|
||||
update_copy_action();
|
||||
update();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue