Polish streaming slash commands (#20345)

This improves the experience in a few ways:

- It avoids merging slash command output sections that are adjacent.
- When hitting cmd-z, all the output from a command is undone at once.
- When deleting a pending command, it stops the command and prevents new
output from flowing in.

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2024-11-07 13:25:26 +01:00 committed by GitHub
parent e62d60c84c
commit 16cbff9118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 140 additions and 106 deletions

View file

@ -1357,7 +1357,7 @@ async fn test_random_context_collaboration(cx: &mut TestAppContext, mut rng: Std
let first_context = contexts[0].read(cx);
for context in &contexts[1..] {
let context = context.read(cx);
assert!(context.pending_ops.is_empty());
assert!(context.pending_ops.is_empty(), "pending ops: {:?}", context.pending_ops);
assert_eq!(
context.buffer.read(cx).text(),
first_context.buffer.read(cx).text(),