@@ -3371,17 +3371,20 @@ pub mod insert {
33713371 }
33723372
33733373 use helix_core::auto_pairs;
3374− const HOOKS: &[Hook] = &[auto_pairs::hook, insert];
3375− const POST_HOOKS: &[PostHook] = &[completion, signature_help];
33763374
33773375 pub fn insert_char(cx: &mut Context, c: char) {
33783376 let (view, doc) = current!(cx.editor);
33793377
3378+ let hooks: &[Hook] = match cx.editor.config.auto_pairs {
3379+ true => &[auto_pairs::hook, insert],
3380+ false => &[insert],
3381+ };
3382+
33803383 let text = doc.text();
33813384 let selection = doc.selection(view.id).clone().cursors(text.slice(..));
33823385
33833386 // run through insert hooks, stopping on the first one that returns Some(t)
3384− for hook in HOOKS {
3387+ for hook in hooks {
33853388 if let Some(transaction) = hook(text, &selection, c) {
33863389 doc.apply(&transaction, view.id);
33873390 break;
@@ -3391,7 +3394,7 @@ pub mod insert {
33913394 // TODO: need a post insert hook too for certain triggers (autocomplete, signature help, etc)
33923395 // this could also generically look at Transaction, but it's a bit annoying to look at
33933396 // Operation instead of Change.
3394− for hook in POST_HOOKS {
3397+ for hook in &[completion, signature_help] {
33953398 hook(cx, c);
33963399 }
33973400 }