Skip to content

Commit 569db72

Browse files
poliorceticspathwave
authored andcommitted
fix: Never create automatic doc popups outside of Insert mode (helix-editor#4456)
1 parent b6ca716 commit 569db72

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

helix-term/src/commands/lsp.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tui::text::{Span, Spans};
99
use super::{align_view, push_jump, Align, Context, Editor, Open};
1010

1111
use helix_core::{path, Selection};
12-
use helix_view::{apply_transaction, editor::Action, theme::Style};
12+
use helix_view::{apply_transaction, document::Mode, editor::Action, theme::Style};
1313

1414
use crate::{
1515
compositor::{self, Compositor},
@@ -957,6 +957,14 @@ pub fn signature_help_impl(cx: &mut Context, invoked: SignatureHelpInvoked) {
957957
return;
958958
}
959959

960+
// If the signature help invocation is automatic, don't show it outside of Insert Mode:
961+
// it very probably means the server was a little slow to respond and the user has
962+
// already moved on to something else, making a signature help popup will just be an
963+
// annoyance, see https://github.com/helix-editor/helix/issues/3112
964+
if !was_manually_invoked && editor.mode != Mode::Insert {
965+
return;
966+
}
967+
960968
let response = match response {
961969
// According to the spec the response should be None if there
962970
// are no signatures, but some servers don't follow this.

0 commit comments

Comments
 (0)