Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window hint breaks popup windows from other plugins #55

Open
sufftea opened this issue Dec 9, 2024 · 1 comment
Open

window hint breaks popup windows from other plugins #55

sufftea opened this issue Dec 9, 2024 · 1 comment

Comments

@sufftea
Copy link

sufftea commented Dec 9, 2024

The problem

After opening and closing hydra's window hint, the windows of other plugins stop closing properly. For example, when I open a vim.lsp.buf.hover window, it doesn't disappear after I move the cursor. The same happens to neo-tree's floating window.

Update: noticed another bug that probably has the same root: when I yank something, the selection doesn't blink.

All of this starts happening only after hydra shows its window hint.

2024-12-09.17-54-04.mp4

Steps to reproduce

  1. Use the config
  2. Press <leader>dh to start hydra
  3. Press <Esc> to close it
  4. Open a vim.lsp.buf.hover window, or neo-tree's floating window.
  5. Try to close that window
  6. It doesn't close

Config

      local dap = require("dap")
      local hint = [[
            ^ ^Step^ ^ ^      ^ ^     Action
        ----^-^-^-^--^-^----  ^-^-------------------
            ^ ^back^ ^ ^     ^_b_: toggle breakpoint
            ^ ^ _C_^ ^        _B_: clear breakpoints
        out _H_ ^ ^ _N_ into  _g_: continue
            ^ ^ _T_ ^ ^       _x_: terminate
            ^ ^over ^ ^     ^^_r_: open repl

            ^ ^  _<Esc>_: exit
       ]]
      require("hydra")({
        name = "Debug",
        hint = hint,
        config = {
          color = "pink",
          invoke_on_body = true,
          hint = {
            type = "window",
            border = "rounded",
          },
        },
        mode = { "n" },
        body = "<leader>dh",
        heads = {
          { "H", dap.step_out, { private = true, desc = "step out" } },
          { "T", dap.step_over, { private = true, desc = "step over" } },
          { "C", dap.step_back, { private = true, desc = "step back" } },
          { "N", dap.step_into, { private = true, desc = "step into" } },
          { private = true, "b", dap.toggle_breakpoint, { private = true, desc = "toggle breakpoint" } },
          { "B", dap.clear_breakpoints, { private = true, desc = "clear breakpoints" } },
          { "g", dap.continue, { private = true, desc = "continue" } },
          { "x", dap.terminate, { private = true, desc = "terminate" } },
          { "r", dap.repl.open, { private = true, exit = true, desc = "open repl" } },
          { "<Esc>", nil, { private = true, exit = true, nowait = true, desc = "exit" } },
        },
      })

@sufftea
Copy link
Author

sufftea commented Dec 12, 2024

A temporary solution for me was to change hint.type to statusline*, and write my own logic for showing the hint window inside on_enter and on_exit.

*there seems to be another bug that statusline doesn't show up on pink hydras, but that's another story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant