Skip to content

Commit

Permalink
fix: Never create automatic doc popups outside of Insert mode (helix-…
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics authored and Frederik Vestre committed Feb 6, 2023
1 parent 6996d4f commit a9846b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a9846b4

Please sign in to comment.