aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorPoliorcetics2022-10-28 23:20:55 +0000
committerGitHub2022-10-28 23:20:55 +0000
commitc58e1729cef774db6619e394942465c12abd65cd (patch)
tree2d11465b598da4f09e3a7c3601547dad262c669d /helix-term/src/commands
parent26f21da531179ccc77e70b73e32a1b458c4e225b (diff)
fix: Never create automatic doc popups outside of Insert mode (#4456)
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/lsp.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 3c72cd2a..d7617c50 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -9,7 +9,7 @@ use tui::text::{Span, Spans};
use super::{align_view, push_jump, Align, Context, Editor, Open};
use helix_core::{path, Selection};
-use helix_view::{apply_transaction, editor::Action, theme::Style};
+use helix_view::{apply_transaction, document::Mode, editor::Action, theme::Style};
use crate::{
compositor::{self, Compositor},
@@ -957,6 +957,14 @@ pub fn signature_help_impl(cx: &mut Context, invoked: SignatureHelpInvoked) {
return;
}
+ // If the signature help invocation is automatic, don't show it outside of Insert Mode:
+ // it very probably means the server was a little slow to respond and the user has
+ // already moved on to something else, making a signature help popup will just be an
+ // annoyance, see https://github.com/helix-editor/helix/issues/3112
+ if !was_manually_invoked && editor.mode != Mode::Insert {
+ return;
+ }
+
let response = match response {
// According to the spec the response should be None if there
// are no signatures, but some servers don't follow this.