mirror of https://github.com/helix-editor/helix
fix mouse right click selection (#10067)
parent
d180395461
commit
92338bc207
|
@ -1263,24 +1263,28 @@ impl EditorView {
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseEventKind::Up(MouseButton::Right) => {
|
MouseEventKind::Up(MouseButton::Right) => {
|
||||||
if let Some((coords, view_id)) = gutter_coords_and_view(cxt.editor, row, column) {
|
if let Some((pos, view_id)) = gutter_coords_and_view(cxt.editor, row, column) {
|
||||||
cxt.editor.focus(view_id);
|
cxt.editor.focus(view_id);
|
||||||
|
|
||||||
let (view, doc) = current!(cxt.editor);
|
if let Some((pos, _)) = pos_and_view(cxt.editor, row, column, true) {
|
||||||
if let Some(pos) =
|
doc_mut!(cxt.editor).set_selection(view_id, Selection::point(pos));
|
||||||
view.pos_at_visual_coords(doc, coords.row as u16, coords.col as u16, true)
|
} else {
|
||||||
{
|
let (view, doc) = current!(cxt.editor);
|
||||||
doc.set_selection(view_id, Selection::point(pos));
|
|
||||||
if modifiers == KeyModifiers::ALT {
|
if let Some(pos) = view.pos_at_visual_coords(doc, pos.row as u16, 0, true) {
|
||||||
commands::MappableCommand::dap_edit_log.execute(cxt);
|
doc.set_selection(view_id, Selection::point(pos));
|
||||||
} else {
|
match modifiers {
|
||||||
commands::MappableCommand::dap_edit_condition.execute(cxt);
|
KeyModifiers::ALT => {
|
||||||
|
commands::MappableCommand::dap_edit_log.execute(cxt)
|
||||||
|
}
|
||||||
|
_ => commands::MappableCommand::dap_edit_condition.execute(cxt),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return EventResult::Consumed(None);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
cxt.editor.ensure_cursor_in_view(view_id);
|
||||||
|
return EventResult::Consumed(None);
|
||||||
|
}
|
||||||
EventResult::Ignored(None)
|
EventResult::Ignored(None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue