Skip to content

Commit

Permalink
Use 2 as the surround_len instead of len_utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
Austen Adler committed Nov 16, 2022
1 parent b3969f2 commit 167dbc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4530,7 +4530,8 @@ fn surround_add(cx: &mut Context) {
let (view, doc) = current!(cx.editor);
let selection = doc.selection(view.id);
let (open, close) = surround::get_pair(ch);
let surround_len = open.len_utf8() + close.len_utf8();
// The number of chars in get_pair
let surround_len = 2;

let mut changes = Vec::with_capacity(selection.len() * 2);
let mut ranges = SmallVec::with_capacity(selection.len());
Expand Down

0 comments on commit 167dbc4

Please # to comment.