Skip to content

Commit

Permalink
Prevent search callbacks on Home/End keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Sep 15, 2023
1 parent 280a7e0 commit bdfb130
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SearchPrompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct(
Key::UP, Key::UP_ARROW, Key::SHIFT_TAB, Key::CTRL_P => $this->highlightPrevious(),
Key::DOWN, Key::DOWN_ARROW, Key::TAB, Key::CTRL_N => $this->highlightNext(),
Key::ENTER => $this->highlighted !== null ? $this->submit() : $this->search(),
Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_B, Key::CTRL_F, Key::CTRL_A, Key::CTRL_E => $this->highlighted = null,
Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_B, Key::CTRL_F, Key::HOME, KEY::END, Key::CTRL_A, Key::CTRL_E => $this->highlighted = null,
default => $this->search(),
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/SuggestPrompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
Key::UP, Key::UP_ARROW, Key::SHIFT_TAB, Key::CTRL_P => $this->highlightPrevious(),
Key::DOWN, Key::DOWN_ARROW, Key::TAB, Key::CTRL_N => $this->highlightNext(),
Key::ENTER => $this->selectHighlighted(),
Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_B, Key::CTRL_F, Key::CTRL_A, Key::CTRL_E => $this->highlighted = null,
Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_B, Key::CTRL_F, Key::HOME, KEY::END, Key::CTRL_A, Key::CTRL_E => $this->highlighted = null,
default => (function () {
$this->highlighted = null;
$this->matches = null;
Expand Down

0 comments on commit bdfb130

Please sign in to comment.