Do not serialize workspace for item activations with no focus changes (#22891)

Follow-up of https://github.com/zed-industries/zed/pull/22730

Fixes excessive workspace serialization, when scrolling over outline
items in the outline panel: the panel will move the caret (selection)
over the file, following its outlines, causing the same item to be
re-activated over and over.


7a7cef2dd1/crates/workspace/src/persistence/model.rs (L257-L268)

does not seem to use position within an item, just the fact whether the
item is active or not:


7a7cef2dd1/crates/workspace/src/persistence/model.rs (L511-L517)

so, stop serializing the workspace state if no focus changes were made,
or the pane activated is the same.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-01-09 13:58:10 +02:00 committed by GitHub
parent a0284a272b
commit 6c50659c30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 6 deletions

View file

@ -595,7 +595,7 @@ impl AssistantPanel {
true
}
pane::Event::ActivateItem { local } => {
pane::Event::ActivateItem { local, .. } => {
if *local {
self.workspace
.update(cx, |workspace, cx| {