mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45: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
|
# Open the editor with the current text
|
||||||
edited_text = pipe_editor(input_data=current_text)
|
edited_text = pipe_editor(input_data=current_text)
|
||||||
|
|
||||||
# Replace the buffer with the edited text
|
# Replace the buffer with the edited text, strip any trailing newlines
|
||||||
buffer.text = edited_text
|
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)
|
@kb.add("enter", eager=True, filter=~is_searching)
|
||||||
def _(event):
|
def _(event):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue