ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.02k stars 57 forks source link

floating_window position happen to shift. #210

Open allworldg opened 2 years ago

allworldg commented 2 years ago

When the floating window appear by trigger , it is great . But if I use toggle_key to close and open again , the window will be shifted .
image

press toggle_key twice to close and open .

image

my setup:

lsp_signature.setup({
  bind = true,
  doc_lines = 1,
  toggle_key = "<C-k>",
  floating_window = true,
  floating_window_above_cur_line = true,
  hint_enable = false, -- virtual hint enable
  close_timeout = 1,
  floating_window_off_x=10,
  floating_windows_off_y=0,
  fix_pos = false,
  log_path = vim.fn.expand("$HOME") .. "/tmp/sig.log",
  -- hi_parameter = "Search",
  timer_interval = 100,
  extra_trigger_chars = {},
  handler_opts = {
    border = "rounded", -- "shadow", --{"╭", "─" ,"╮", "│", "╯", "─", "╰", "│" },
  },
  max_height = 4,
})
NGPONG commented 1 month ago

same problem here.

NGPONG commented 1 month ago

It seems that this part is the one affecting the situation.

https://github.com/ray-x/lsp_signature.nvim/blob/a38da0a61c172bb59e34befc12efe48359884793/lua/lsp_signature/init.lua#L467-L470

When triggered manually, the triggered_chars parameter is not passed. After removing this condition, the issue is resolved, but I'm uncertain whether this might lead to other side effects. Do you have any insights on this? @ray-x