Attempt to assign a language when a new buffer is saved

This commit is contained in:
Nathan Sobo
2021-09-18 11:46:22 -07:00
parent cab577406d
commit af99d0ef42
3 changed files with 24 additions and 1 deletions
+5
View File
@@ -4,6 +4,7 @@ mod element;
pub mod movement;
use crate::{
language::Language,
settings::Settings,
theme::Theme,
time::ReplicaId,
@@ -449,6 +450,10 @@ impl Editor {
}
}
pub fn language<'a>(&self, cx: &'a AppContext) -> Option<&'a Arc<Language>> {
self.buffer.read(cx).language()
}
pub fn set_placeholder_text(
&mut self,
placeholder_text: impl Into<Arc<str>>,