From 97da93c9ec65b1efb2534540da0f216f3f073789 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 9 Mar 2022 15:44:58 +0100 Subject: [PATCH] :lipstick: --- crates/editor/src/editor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index d18d3e4790..5dacef7f20 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -1640,9 +1640,9 @@ impl Editor { let text = action.0.as_ref(); if !self.skip_autoclose_end(text, cx) { self.start_transaction(cx); - if !self.surround_with_pair(text, cx) { + if !self.surround_with_bracket_pair(text, cx) { self.insert(text, cx); - self.autoclose_pairs(cx); + self.autoclose_bracket_pairs(cx); } self.end_transaction(cx); self.trigger_completion_on_input(text, cx); @@ -1826,7 +1826,7 @@ impl Editor { } } - fn surround_with_pair(&mut self, text: &str, cx: &mut ViewContext) -> bool { + fn surround_with_bracket_pair(&mut self, text: &str, cx: &mut ViewContext) -> bool { let snapshot = self.buffer.read(cx).snapshot(cx); if let Some(pair) = snapshot .language() @@ -1873,7 +1873,7 @@ impl Editor { } } - fn autoclose_pairs(&mut self, cx: &mut ViewContext) { + fn autoclose_bracket_pairs(&mut self, cx: &mut ViewContext) { let selections = self.local_selections::(cx); let mut bracket_pair_state = None; let mut new_selections = None;