feat: Improve C-x C-e editor keybinding to handle cursor and newline

This commit is contained in:
Matteo Landi (aider) 2025-03-27 10:35:03 +01:00
parent 4f5ed8ace0
commit 7924657584

View file

@ -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):