Don't reuse old syntax tree when resetting a buffer's language
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
5c7f2bb029
commit
7e3cc67e0a
4 changed files with 45 additions and 5 deletions
|
@ -486,6 +486,7 @@ impl Buffer {
|
|||
}
|
||||
|
||||
pub fn set_language(&mut self, language: Option<Arc<Language>>, cx: &mut ModelContext<Self>) {
|
||||
*self.syntax_tree.lock() = None;
|
||||
self.language = language;
|
||||
self.reparse(cx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue