agent: Support inserting selections as context via @selection
(#29045)
WIP Release Notes: - N/A
This commit is contained in:
parent
10ded0ab75
commit
a5852d4537
10 changed files with 548 additions and 191 deletions
|
@ -3108,6 +3108,13 @@ impl Editor {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn has_non_empty_selection(&self, cx: &mut App) -> bool {
|
||||
self.selections
|
||||
.all_adjusted(cx)
|
||||
.iter()
|
||||
.any(|selection| !selection.is_empty())
|
||||
}
|
||||
|
||||
pub fn has_pending_nonempty_selection(&self) -> bool {
|
||||
let pending_nonempty_selection = match self.selections.pending_anchor() {
|
||||
Some(Selection { start, end, .. }) => start != end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue