ZIm/crates/project/src
gcp-cherry-pick-bot[bot] 780db4ce76
Fix redo after noop format (cherry-pick #34898) (#34903)
Cherry-picked Fix redo after noop format (#34898)

Closes #31917

Previously, as of #28457 we used a hack, creating an empty transaction
in the history that we then merged formatting changes into in order to
correctly identify concurrent edits to the buffer while formatting was
happening. This caused issues with noop formatting however, as using the
normal API of the buffer history (in an albeit weird way) resulted in
the redo stack being cleared, regardless of whether the formatting
transaction included edits or not, which is the correct behavior in all
other contexts.

This PR fixes the redo issue by codifying the behavior formatting wants,
that being the ability to push an empty transaction to the history with
no other side-effects (i.e. clearing the redo stack) to detect
concurrent edits, with the tradeoff being that it must then manually
remove the transaction later if no changes occurred from the formatting.
The redo stack is still cleared when there are formatting edits, as the
individual format steps use the normal `{start,end}_transaction` methods
which clear the redo stack if the finished transaction isn't empty.

Release Notes:

- Fixed an issue where redo would not work after buffer formatting
(including formatting on save) when the formatting did not result in any
changes

Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-07-22 13:56:45 -04:00
..
context_server_store agent: Fix bug that prevented MCP servers to appear in the settings view (#33857) 2025-07-03 15:05:29 +00:00
debugger debugger: Highlight the size of jumped-to memory (#34504) 2025-07-15 23:32:48 +00:00
git_store chore: Bump Rust version to 1.88 (#33439) 2025-06-26 20:54:19 +02:00
lsp_command lsp: Complete overloaded signature help implementation (#33199) 2025-07-02 20:51:08 +03:00
lsp_store keymap_ui: Auto complete action arguments (cherry-pick #34785) (#34790) 2025-07-20 17:07:39 -04:00
manifest_tree project: Fix up documentation for Path Trie and add a test for having multiple present nodes (#34560) 2025-07-16 17:24:34 +00:00
buffer_store.rs Add language server control tool into the status bar (#32490) 2025-06-25 19:57:28 +03:00
color_extractor.rs Simplify static expression to a constant (#23193) 2025-01-15 19:31:21 +00:00
connection_manager.rs Finish removing git repository state and scanning logic from worktrees (#27568) 2025-04-01 17:41:20 -04:00
context_server_store.rs agent_ui: Fix disabled context servers not showing in agent setting (#33856) 2025-07-07 12:02:33 +02:00
debounced_delay.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
debugger.rs debugger: Add memory view (#33955) 2025-07-14 16:32:06 +02:00
direnv.rs Fix parsing of direnv export json to support unset of environment variables + better logging (#32559) 2025-06-11 17:57:30 +00:00
environment.rs ACP (#34030) 2025-07-09 16:02:31 +00:00
git_store.rs Revert "git: Intercept signing prompt from GPG when committing" (#34306) 2025-07-11 23:20:35 +00:00
image_store.rs zlog: Replace usages of env_logger in tests with zlog (#31436) 2025-05-26 11:48:50 -04:00
lsp_command.rs languages: Fix ESLint diagnostics not getting shown (#33814) 2025-07-14 13:48:56 +03:00
lsp_store.rs Fix redo after noop format (cherry-pick #34898) (#34903) 2025-07-22 13:56:45 -04:00
manifest_tree.rs python: Re-land usage of source file path in toolchain picker (#31893) 2025-06-02 16:29:06 +00:00
prettier_store.rs Fix language settings formatter regression - formatter list can be a single formatter not wrapped in an array (#33721) 2025-07-01 17:47:19 +00:00
project.rs Return back the guards when goto targets are queried for (#34340) 2025-07-12 18:27:52 +03:00
project_settings.rs Add severity argument to GoToDiagnostic actions (#33995) 2025-07-15 14:03:57 +00:00
project_tests.rs debugger: Fix the JavaScript debug terminal scenario (#33924) 2025-07-05 19:48:55 -04:00
search.rs vim: Implement /n and /c in :s (#34102) 2025-07-09 06:14:04 +00:00
search_history.rs project: Use checked_sub for next/previous in search history (#34408) 2025-07-15 16:42:37 +02:00
task_inventory.rs debugger: Debug sessions rerun build tasks by default when restarting (#33724) 2025-07-01 15:43:58 -04:00
task_store.rs Add initial package.json scripts task autodetection (#32497) 2025-06-10 22:16:27 +00:00
terminals.rs Appropriately pick venv activation script (#33205) 2025-07-16 12:52:37 +00:00
toolchain_store.rs debugger: Fix running JS tests when worktree root and package root do not coincide (#32644) 2025-06-13 05:03:07 +00:00
worktree_store.rs windows: Add support for SSH (#29145) 2025-07-08 14:34:57 +00:00
yarn.rs Use read-only access methods for read-only entity operations (#31479) 2025-05-26 23:04:31 -04:00