Merge pull request #2263 from zed-industries/language-status-bar
Language status bar
This commit is contained in:
commit
30a08467b0
12 changed files with 183 additions and 35 deletions
|
@ -1082,18 +1082,21 @@ impl MultiBuffer {
|
|||
|
||||
let mut cursor = snapshot.excerpts.cursor::<usize>();
|
||||
cursor.seek(&position, Bias::Right, &());
|
||||
cursor.item().map(|excerpt| {
|
||||
(
|
||||
excerpt.id.clone(),
|
||||
self.buffers
|
||||
.borrow()
|
||||
.get(&excerpt.buffer_id)
|
||||
.unwrap()
|
||||
.buffer
|
||||
.clone(),
|
||||
excerpt.range.context.clone(),
|
||||
)
|
||||
})
|
||||
cursor
|
||||
.item()
|
||||
.or_else(|| snapshot.excerpts.last())
|
||||
.map(|excerpt| {
|
||||
(
|
||||
excerpt.id.clone(),
|
||||
self.buffers
|
||||
.borrow()
|
||||
.get(&excerpt.buffer_id)
|
||||
.unwrap()
|
||||
.buffer
|
||||
.clone(),
|
||||
excerpt.range.context.clone(),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// If point is at the end of the buffer, the last excerpt is returned
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue