Skip to content

Commit 167dbc4

Browse files
author
Austen Adler
committed
Use 2 as the surround_len instead of len_utf8
1 parent b3969f2 commit 167dbc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

helix-term/src/commands.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4530,7 +4530,8 @@ fn surround_add(cx: &mut Context) {
45304530
let (view, doc) = current!(cx.editor);
45314531
let selection = doc.selection(view.id);
45324532
let (open, close) = surround::get_pair(ch);
4533-
let surround_len = open.len_utf8() + close.len_utf8();
4533+
// The number of chars in get_pair
4534+
let surround_len = 2;
45344535

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

0 commit comments

Comments
 (0)