Set buffer language when confirming selection in language selector
Co-Authored-By: Julia Risley <julia@zed.dev>
This commit is contained in:
parent
b402f27d50
commit
686f5439ad
5 changed files with 89 additions and 41 deletions
|
@ -1254,6 +1254,15 @@ impl Editor {
|
|||
self.buffer.read(cx).language_at(point, cx)
|
||||
}
|
||||
|
||||
pub fn active_excerpt(
|
||||
&self,
|
||||
cx: &AppContext,
|
||||
) -> Option<(ExcerptId, ModelHandle<Buffer>, Range<text::Anchor>)> {
|
||||
self.buffer
|
||||
.read(cx)
|
||||
.excerpt_containing(self.selections.newest_anchor().head(), cx)
|
||||
}
|
||||
|
||||
fn style(&self, cx: &AppContext) -> EditorStyle {
|
||||
build_style(
|
||||
cx.global::<Settings>(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue