From 2ea20a23e26a771e095972bdda673d491b4aacc5 Mon Sep 17 00:00:00 2001
From: Jummit <jummit@web.de>
Date: Fri, 9 Dec 2022 05:02:34 +0100
Subject: [PATCH] Fix LSP completions ignoring auto-completion option (#5042)

---
 helix-term/src/commands.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 1843e7a2..2bac5be0 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3049,6 +3049,11 @@ pub mod insert {
     }
 
     fn language_server_completion(cx: &mut Context, ch: char) {
+        let config = cx.editor.config();
+        if !config.auto_completion {
+            return;
+        }
+
         use helix_lsp::lsp;
         // if ch matches completion char, trigger completion
         let doc = doc_mut!(cx.editor);