A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/edi.rs')
-rw-r--r--src/edi.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/edi.rs b/src/edi.rs
index 42803fb..5cb395f 100644
--- a/src/edi.rs
+++ b/src/edi.rs
@@ -950,6 +950,34 @@ impl Editor {
l.matching_brace(f, &mut self.text);
}
}
+ Some(Do::DeleteBracketPair) => {
+ if let Some((l, f)) = lsp!(self + p) {
+ if let Ok(x) = l.matching_brace_at(
+ f,
+ self.text.cursor.positions(&self.text.rope),
+ ) {
+ use itertools::Itertools;
+ for p in
+ // self.text.cursor.iter()
+ x
+ .iter()
+ .flatten()
+ .flat_map(|(a, b)| {
+ [a, b].map(|c| {
+ self.text
+ .rope
+ .l_position(*c)
+ .unwrap()
+ })
+ })
+ .sorted()
+ .rev()
+ {
+ self.text.remove(p..p + 1).unwrap();
+ }
+ }
+ }
+ }
Some(Do::Symbols) =>
if let Some(lsp) = lsp!(self) {
let mut q = Rq::new(