Skip to content

Preserve viewport edit draft when queued request executes#666

Open
liaowang11 wants to merge 1 commit into
xenodium:mainfrom
liaowang11:preserve-viewport-edit-draft
Open

Preserve viewport edit draft when queued request executes#666
liaowang11 wants to merge 1 commit into
xenodium:mainfrom
liaowang11:preserve-viewport-edit-draft

Conversation

@liaowang11

Copy link
Copy Markdown
Contributor

What

When a command is sent (e.g. a queued request executing) while the user is composing in the viewport edit buffer, the draft is now saved to the compose snapshot instead of being wiped by the switch to view mode. The draft is restored on the next return to edit mode.

Why

agent-shell--send-command switches the viewport to view mode and re-initializes the buffer. If a queued request runs while the user is mid-composition in the viewport edit buffer, their in-progress draft was lost. Reusing the existing agent-shell-viewport--compose-snapshot mechanism preserves it.

Checklist

  • I agree to communicate (PR description and comments) with the author myself (not AI-generated).
  • I've reviewed all code in PR myself and will vouch for its quality.
  • I've read and followed the Contributing guidelines.
  • I've filed a feature request/discussion for a new feature.
  • I'm making visual changes, so I'm including screenshots so you can view and discuss.
  • I've added tests where applicable.
  • I've updated documentation where necessary.
  • I've run M-x checkdoc and M-x byte-compile-file.

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.

1 participant