Skip to content

Commit a5a5b10

Browse files
committed
review comments
1 parent faf9b8b commit a5a5b10

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

helix-core/src/auto_pairs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ fn handle_open(doc: &Rope, selection: &Selection, pair: &Pair) -> Transaction {
272272
let next_char = doc.get_char(cursor);
273273
let len_inserted;
274274

275+
// Since auto pairs are currently limited to single chars, we're either
276+
// inserting exactly one or two chars. When arbitrary length pairs are
277+
// added, these will need to be changed.
275278
let change = match next_char {
276279
Some(_) if !pair.should_close(doc, start_range) => {
277280
len_inserted = 1;

helix-term/tests/test/auto_pairs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ async fn insert_basic() -> anyhow::Result<()> {
2828

2929
#[tokio::test]
3030
async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> {
31-
// [NOTE] these are multi-byte Unicode characters
32-
let pairs = hashmap!('„' => '“', '‚' => '‘');
31+
// NOTE: these are multi-byte Unicode characters
32+
let pairs = hashmap!('„' => '“', '‚' => '‘', '「' => '」');
33+
3334
let config = Config {
3435
editor: helix_view::editor::Config {
3536
auto_pairs: AutoPairConfig::Pairs(pairs.clone()),

0 commit comments

Comments
 (0)