hold shift and click to add to selection
This commit is contained in:
parent
88438642a6
commit
4983e05f01
1 changed files with 20 additions and 11 deletions
|
|
@ -1145,18 +1145,27 @@ where
|
||||||
} else {
|
} else {
|
||||||
TermSide::Right
|
TermSide::Right
|
||||||
};
|
};
|
||||||
let selection = match click_kind {
|
// Check if shift is pressed and there's an existing selection to extend
|
||||||
ClickKind::Single => {
|
if state.modifiers.shift() {
|
||||||
Selection::new(SelectionType::Simple, location, side)
|
let mut term = terminal.term.lock();
|
||||||
|
if let Some(ref mut selection) = term.selection {
|
||||||
|
selection.update(location, side);
|
||||||
|
} else {
|
||||||
|
term.selection =
|
||||||
|
Some(Selection::new(SelectionType::Simple, location, side));
|
||||||
}
|
}
|
||||||
ClickKind::Double => {
|
} else {
|
||||||
Selection::new(SelectionType::Semantic, location, side)
|
let selection = match click_kind {
|
||||||
}
|
ClickKind::Single => {
|
||||||
ClickKind::Triple => {
|
Selection::new(SelectionType::Simple, location, side)
|
||||||
Selection::new(SelectionType::Lines, location, side)
|
}
|
||||||
}
|
ClickKind::Double => {
|
||||||
};
|
Selection::new(SelectionType::Semantic, location, side)
|
||||||
{
|
}
|
||||||
|
ClickKind::Triple => {
|
||||||
|
Selection::new(SelectionType::Lines, location, side)
|
||||||
|
}
|
||||||
|
};
|
||||||
let mut term = terminal.term.lock();
|
let mut term = terminal.term.lock();
|
||||||
term.selection = Some(selection);
|
term.selection = Some(selection);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue