Introduce a status bar and add the cursor position to it
Co-Authored-By: Nathan Sobo <nathan@zed.dev> Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
306ebb256c
commit
a26b066788
7 changed files with 269 additions and 6 deletions
|
@ -2219,6 +2219,21 @@ impl Editor {
|
|||
.map(|(set_id, _)| *set_id)
|
||||
}
|
||||
|
||||
pub fn last_selection(&self, cx: &AppContext) -> Selection<Point> {
|
||||
if let Some(pending_selection) = self.pending_selection.as_ref() {
|
||||
pending_selection.clone()
|
||||
} else {
|
||||
let buffer = self.buffer.read(cx);
|
||||
let last_selection = buffer
|
||||
.selection_set(self.selection_set_id)
|
||||
.unwrap()
|
||||
.point_selections(buffer)
|
||||
.max_by_key(|s| s.id)
|
||||
.unwrap();
|
||||
last_selection
|
||||
}
|
||||
}
|
||||
|
||||
pub fn selections_in_range<'a>(
|
||||
&'a self,
|
||||
set_id: SelectionSetId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue