mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: Improve C-x C-e editor keybinding to handle cursor and newline
This commit is contained in:
parent
4f5ed8ace0
commit
7924657584
1 changed files with 5 additions and 2 deletions
|
@ -567,8 +567,11 @@ class InputOutput:
|
|||
# Open the editor with the current text
|
||||
edited_text = pipe_editor(input_data=current_text)
|
||||
|
||||
# Replace the buffer with the edited text
|
||||
buffer.text = edited_text
|
||||
# Replace the buffer with the edited text, strip any trailing newlines
|
||||
buffer.text = edited_text.rstrip('\n')
|
||||
|
||||
# Move cursor to the end of the text
|
||||
buffer.cursor_position = len(buffer.text)
|
||||
|
||||
@kb.add("enter", eager=True, filter=~is_searching)
|
||||
def _(event):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue