mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
Assign the language registry to all buffers in the project
This commit is contained in:
parent
a66a0cfd70
commit
7003a475a7
1 changed files with 4 additions and 1 deletions
|
@ -1480,6 +1480,10 @@ impl Project {
|
|||
buffer: &ModelHandle<Buffer>,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Result<()> {
|
||||
buffer.update(cx, |buffer, _| {
|
||||
buffer.set_language_registry(self.languages.clone())
|
||||
});
|
||||
|
||||
let remote_id = buffer.read(cx).remote_id();
|
||||
let open_buffer = if self.is_remote() || self.is_shared() {
|
||||
OpenBuffer::Strong(buffer.clone())
|
||||
|
@ -1803,7 +1807,6 @@ impl Project {
|
|||
if buffer.language().map_or(true, |old_language| {
|
||||
!Arc::ptr_eq(old_language, &new_language)
|
||||
}) {
|
||||
buffer.set_language_registry(self.languages.clone());
|
||||
buffer.set_language(Some(new_language.clone()), cx);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue