Do not serialize workspace for item activations with no focus changes (#22891)
Kirill Bulatov
created
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.
https://github.com/zed-industries/zed/blob/7a7cef2dd1085ba93bae29711f0adff8969e8bdf/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:
https://github.com/zed-industries/zed/blob/7a7cef2dd1085ba93bae29711f0adff8969e8bdf/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