ZIm/crates/editor/src
Nathan Sobo da8d1306af
Open workflow step editors as preview tabs (#15928)
This PR opens workflow step editors as preview tabs and closes them upon
exiting the step if they are still in preview mode and they weren't
already open before entering the step.

Making this work was tricky, because we often edit the buffer as part of
displaying the workflow step suggestions to create empty lines where we
can generate. We undo these edits if the transformation is not applied,
but they were causing the preview to be dismissed.

After trying a few approaches, I decided to give workspace `Item`s a
`preserve_preview` method that defaults to false. When the workspace
sees an edit event for the item, it checks if the item wants to preserve
its preview. For buffers, after editing, you can call `refresh_preview`,
which sets a preview version to the current version of the buffer. Any
edits after this version will cause preview to not be preserved.

One final issue is with async auto-indent. To ensure these async edits
don't dismiss the preview, I automatically refresh the preview version
if preview was preserved prior to performing the auto-indent. The
assumption is that these are edits created by other edits, and if we
didn't want to dismiss the preview with the originating edits, then the
auto-indent edits shouldn't dismiss it either.

Release Notes:

- N/A

---------

Co-authored-by: Jason <jason@zed.dev>
2024-08-07 19:33:58 -06:00
..
display_map Don't insert unnecessary space below the end of an inline transformation (#15865) 2024-08-06 19:00:23 +02:00
git Update http crate name (#15041) 2024-07-23 15:01:05 -07:00
scroll Clean up inline assist editor rendering (#15536) 2024-07-31 17:43:08 +02:00
signature_help lsp: Implement textDocument/signatureHelp for ProjectClientState::Local environment (#12909) 2024-07-11 13:38:33 +03:00
test chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
actions.rs lsp: Support Goto Declaration (#15785) 2024-08-06 11:20:51 +02:00
blame_entry_tooltip.rs Add button to copy SHA from Git blame (#14883) 2024-07-21 12:02:16 -04:00
blink_manager.rs Hide blinking cursor when window is deactivated (#15408) 2024-07-30 10:49:15 +03:00
debounced_delay.rs editor: Cancel ongoing completion requests more eagerly (#12630) 2024-06-04 12:22:01 +02:00
display_map.rs Clean up inline assist editor rendering (#15536) 2024-07-31 17:43:08 +02:00
editor.rs lsp: Support Goto Declaration (#15785) 2024-08-06 11:20:51 +02:00
editor_settings.rs settings_ui: Add line number settings controls (#15310) 2024-07-26 18:31:45 -04:00
editor_settings_controls.rs ui: Give NumericSteppers an ID (#15344) 2024-07-27 13:02:27 -04:00
editor_tests.rs chore: Remove leftover code from #15646 (#15697) 2024-08-02 20:08:57 +02:00
element.rs Don't insert unnecessary space below the end of an inline transformation (#15865) 2024-08-06 19:00:23 +02:00
git.rs Introduce DisplayRow, MultiBufferRow newtypes and BufferRow type alias (#11656) 2024-05-11 00:06:51 +03:00
highlight_matching_bracket.rs Add support for auto surround (#13217) 2024-06-20 12:48:46 +03:00
hover_links.rs lsp: Check if "Goto Definition" supported before request (#15111) 2024-07-24 23:28:23 +03:00
hover_popover.rs Selectable diagnostic popover text (#14518) 2024-07-28 23:13:13 -06:00
hunk_diff.rs Clean up inline assist editor rendering (#15536) 2024-07-31 17:43:08 +02:00
indent_guides.rs indent guides: Fix edge case when line is folded (#13498) 2024-06-25 12:00:40 +02:00
inlay_hint_cache.rs Handle buffer diff base updates and file renames properly for SSH projects (#14989) 2024-07-23 11:32:37 -07:00
inline_completion_provider.rs Truncate line when accepting inline suggestions for Supermaven (#13884) 2024-07-22 11:59:38 -07:00
items.rs Open workflow step editors as preview tabs (#15928) 2024-08-07 19:33:58 -06:00
linked_editing_ranges.rs lsp: Add support for linked editing range edits (HTML tag autorenaming) (#12769) 2024-06-11 15:52:38 +02:00
mouse_context_menu.rs lsp: Support Goto Declaration (#15785) 2024-08-06 11:20:51 +02:00
movement.rs Improve context expansion (#10957) 2024-05-26 16:30:09 -07:00
persistence.rs zed: Mark restored buffers as conflicted if file changed on disk between store & restore (#15207) 2024-07-25 18:04:47 +02:00
rust_analyzer_ext.rs Start on adding support for editing via the assistant panel (#14795) 2024-07-19 11:13:15 +02:00
scroll.rs Clean up inline assist editor rendering (#15536) 2024-07-31 17:43:08 +02:00
selections_collection.rs chore: Bump Rust version to 1.80 (#15186) 2024-07-25 22:48:42 +02:00
signature_help.rs lsp: Implement textDocument/signatureHelp for ProjectClientState::Local environment (#12909) 2024-07-11 13:38:33 +03:00
tasks.rs refactoring: Use helper instead of adjusting selection manually (#15262) 2024-07-26 11:12:33 +02:00
test.rs Feature/fallback fonts (#15306) 2024-07-26 16:42:21 -07:00