@@ -3371,17 +3371,20 @@ pub mod insert {
3373 use helix_core::auto_pairs;
3373 use helix_core::auto_pairs;
3374− const HOOKS: &[Hook] = &[auto_pairs::hook, insert];
3375− const POST_HOOKS: &[PostHook] = &[completion, signature_help];
3377 pub fn insert_char(cx: &mut Context, c: char) {
3375 pub fn insert_char(cx: &mut Context, c: char) {
3378 let (view, doc) = current!(cx.editor);
3376 let (view, doc) = current!(cx.editor);
3378+ let hooks: &[Hook] = match cx.editor.config.auto_pairs {
3379+ true => &[auto_pairs::hook, insert],
3380+ false => &[insert],
3380 let text = doc.text();
3383 let text = doc.text();
3381 let selection = doc.selection(view.id).clone().cursors(text.slice(..));
3384 let selection = doc.selection(view.id).clone().cursors(text.slice(..));
3383 // run through insert hooks, stopping on the first one that returns Some(t)
3386 // run through insert hooks, stopping on the first one that returns Some(t)
3384− for hook in HOOKS {
3387+ for hook in hooks {
3385 if let Some(transaction) = hook(text, &selection, c) {
3388 if let Some(transaction) = hook(text, &selection, c) {
3386 doc.apply(&transaction, view.id);
3389 doc.apply(&transaction, view.id);
@@ -3391,7 +3394,7 @@ pub mod insert {
3391 // TODO: need a post insert hook too for certain triggers (autocomplete, signature help, etc)
3394 // TODO: need a post insert hook too for certain triggers (autocomplete, signature help, etc)
3392 // this could also generically look at Transaction, but it's a bit annoying to look at
3395 // this could also generically look at Transaction, but it's a bit annoying to look at
3393 // Operation instead of Change.
3396 // Operation instead of Change.
3394− for hook in POST_HOOKS {
3397+ for hook in &[completion, signature_help] {
3395 hook(cx, c);
3398 hook(cx, c);