From 5f2fe5fca516fa2b55d3020004ab0cec60251e89 Mon Sep 17 00:00:00 2001 From: Triton171 Date: Thu, 29 Dec 2022 16:23:40 +0100 Subject: Fix erroneous indent between closers of auto-pairs (#5330) inserting a newline between 2 closers of an auto-pair.--- helix-term/src/commands.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 437e11b5..7ee1d77c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3173,8 +3173,7 @@ pub mod insert { let on_auto_pair = doc .auto_pairs(cx.editor) .and_then(|pairs| pairs.get(prev)) - .and_then(|pair| if pair.close == curr { Some(pair) } else { None }) - .is_some(); + .map_or(false, |pair| pair.open == prev && pair.close == curr); let local_offs = if on_auto_pair { let inner_indent = indent.clone() + doc.indent_style.as_str(); -- cgit v1.2.3-70-g09d2