Remove if-not-else patterns (#10402)
This commit is contained in:
parent
36a87d0f5c
commit
eb6f7c1240
24 changed files with 99 additions and 99 deletions
|
@ -447,14 +447,14 @@ impl TerminalElement {
|
|||
if e.pressed_button.is_some() && !cx.has_active_drag() {
|
||||
let hovered = hitbox.is_hovered(cx);
|
||||
terminal.update(cx, |terminal, cx| {
|
||||
if !terminal.selection_started() {
|
||||
if terminal.selection_started() {
|
||||
terminal.mouse_drag(e, origin, hitbox.bounds);
|
||||
cx.notify();
|
||||
} else {
|
||||
if hovered {
|
||||
terminal.mouse_drag(e, origin, hitbox.bounds);
|
||||
cx.notify();
|
||||
}
|
||||
} else {
|
||||
terminal.mouse_drag(e, origin, hitbox.bounds);
|
||||
cx.notify();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -222,21 +222,21 @@ impl TerminalView {
|
|||
}
|
||||
|
||||
fn show_character_palette(&mut self, _: &ShowCharacterPalette, cx: &mut ViewContext<Self>) {
|
||||
if !self
|
||||
if self
|
||||
.terminal
|
||||
.read(cx)
|
||||
.last_content
|
||||
.mode
|
||||
.contains(TermMode::ALT_SCREEN)
|
||||
{
|
||||
cx.show_character_palette();
|
||||
} else {
|
||||
self.terminal.update(cx, |term, cx| {
|
||||
term.try_keystroke(
|
||||
&Keystroke::parse("ctrl-cmd-space").unwrap(),
|
||||
TerminalSettings::get_global(cx).option_as_meta,
|
||||
)
|
||||
});
|
||||
} else {
|
||||
cx.show_character_palette();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue