mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
Allow selection of Ctrl-R search results
This may be an issue upstream in PTK or it might be because we override all sorts of keybindings to allow for a friendlier multiline experience. In any case, registering an explicit keybinding to break out of the search mode restores the functionality.
This commit is contained in:
parent
10774002e5
commit
21c7388ea1
1 changed files with 7 additions and 1 deletions
|
@ -2,9 +2,10 @@
|
|||
"""Key bindings for prompt_toolkit xonsh shell."""
|
||||
import builtins
|
||||
|
||||
from prompt_toolkit import search
|
||||
from prompt_toolkit.enums import DEFAULT_BUFFER
|
||||
from prompt_toolkit.filters import (Condition, IsMultiline, HasSelection,
|
||||
EmacsInsertMode, ViInsertMode)
|
||||
EmacsInsertMode, ViInsertMode, IsSearching)
|
||||
from prompt_toolkit.keys import Keys
|
||||
from prompt_toolkit.application.current import get_app
|
||||
|
||||
|
@ -339,6 +340,11 @@ def load_xonsh_bindings(key_bindings):
|
|||
b.cursor_left(count=abs(relative_begin_index))
|
||||
b.cursor_down(count=1)
|
||||
|
||||
@handle(Keys.ControlM, filter=IsSearching())
|
||||
@handle(Keys.ControlJ, filter=IsSearching())
|
||||
def accept_search(event):
|
||||
search.accept_search()
|
||||
|
||||
@handle(Keys.ControlI, filter=insert_mode)
|
||||
def generate_completions(event):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue