Skip to content

Fix forward deletion of the first prompt character - #271

Merged
ericdallo merged 1 commit into
editor-code-assistant:masterfrom
agzam:fix-forward-delete-prompt-start
Jul 15, 2026
Merged

ericdallo merged 1 commit into
editor-code-assistant:masterfrom
agzam:fix-forward-delete-prompt-start

Conversation

@agzam

@agzam agzam commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • A forward deletion of the very first prompt character was blocked by the prompt-boundary guard in eca-chat--key-pressed-deletion, which dinged on any deletion at the prompt-field start regardless of direction. So C-d and, under evil, ~ (evil-invert-char), r, x and s left the first char in place - ~ prepended the inverted char instead of replacing it.
  • At the prompt-field start the guard now dings only for backward-deleting commands (and a negative delete count); forward deletions fall through and remove the first char. The guard above the prompt field (context/progress area) and all backward deletions are unchanged.
  • Adds a buttercup regression test (plain delete-char plus the evil operators) and a CHANGELOG entry.

Testing

  • buttercup: 104 specs, 0 failed.

`eca-chat--key-pressed-deletion' guarded the prompt boundary by dinging
on any deletion at the prompt-field start, ignoring direction. That
swallowed the forward `delete-char' issued by `C-d' and, under evil, the
`~' (`evil-invert-char'), `r', `x' and `s' operators, so they left the
first character in place (`~' prepended the inverted char instead of
replacing it).

At the prompt-field start, ding only for backward-deleting commands (and
a negative delete count); forward deletions fall through and remove the
first char. The guard above the prompt field is unchanged. Add a
regression test and a changelog entry.
@agzam
agzam marked this pull request as ready for review July 14, 2026 23:00

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ericdallo
ericdallo merged commit 3a4861b into editor-code-assistant:master Jul 15, 2026
15 checks passed
agzam added a commit to agzam/.emacs.d that referenced this pull request Jul 15, 2026
The advice let evil's forward operators (~, r, x, s) delete the first
prompt char, which eca-chat--key-pressed-deletion swallowed regardless
of direction. Fixed upstream, so the workaround is no longer needed:
editor-code-assistant/eca-emacs#271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants