From 7c4615519befe8c35b25e22620d45b07b4b9c401 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 2 Oct 2024 14:23:59 -0400 Subject: [PATCH] editor: Ensure proposed changes editor is syntax-highlighted when opened (#18648) This PR fixes an issue where the proposed changes editor would not have any syntax highlighting until a modification was made. When creating the branch buffer we reparse the buffer to rebuild the syntax map. Release Notes: - N/A --- crates/language/src/buffer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rs index 20ecd9594b9d4..1f4c56ecc86ff 100644 --- a/crates/language/src/buffer.rs +++ b/crates/language/src/buffer.rs @@ -819,6 +819,9 @@ impl Buffer { branch.set_language_registry(language_registry); } + // Reparse the branch buffer so that we get syntax highlighting immediately. + branch.reparse(cx); + branch }) }