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

Controls not re-rendering until cursor enters or exits controls window #251

Closed
pcattori opened this issue Mar 23, 2023 · 8 comments
Closed

Comments

@pcattori
Copy link

Controls do not rerender until I click or my cursor enters the controls window.

Video repro: https://youtu.be/D3GB6h4UDkg

Config

      local dapui = require("dapui")
      dapui.setup()
      dap.listeners.after.event_initialized["dapui_config"] = dapui.open
      dap.listeners.before.event_terminated["dapui_config"] = dapui.close
      dap.listeners.before.event_exited["dapui_config"] = dapui.close

Full config: https://github.com/pcattori/nvim/blob/main/lua/plugins/dap.lua

@pcattori pcattori changed the title Controls not rerendering automatically Controls not rerendering until click or cursor enters controls window Mar 23, 2023
@pcattori pcattori changed the title Controls not rerendering until click or cursor enters controls window Controls not re-rendering until cursor enters or exits controls window Mar 23, 2023
@rcarriga
Copy link
Owner

The controls use the winbar setting so it's likely that something else is setting it. Do you have a plugin that sets it?

@ichirou2910
Copy link

I have this same problem too. After using bisect, I've found that it's commit 5c572cd (or the one before that, from what i see this commit here fixed the issue of the previous commit) that caused the issue. Hope that helps.

@pcattori
Copy link
Author

The controls use the winbar setting so it's likely that something else is setting it. Do you have a plugin that sets it?

I'm using LazyVim so I checked that my personal config is not setting winbar, and doesn't seem like any LazyVim built-in plugins are using winbar either.

When I have some time, I'll try to repro on nvim without any config and with just the LazyVim defaults to see if that makes a difference. Will probably wait until Neovim v0.9 is released so I can use NVIM_APPNAME to quickly compare.

@pcattori
Copy link
Author

pcattori commented Apr 7, 2023

I was able to reproduce this with a clean LazyVim installation on Neovim 0.9 and adding one file for configuring dap.

Screen Shot 2023-04-07 at 1 28 35 PM

Notice that debugging is paused at line 6, but the controls look like:

Screen Shot 2023-04-07 at 1 29 46 PM

I expected them instead to look like:

Screen Shot 2023-04-07 at 1 29 51 PM

If my cursor enters the controls window (either by clicking or using window navigation keymaps), then the controls redraw correctly.

Also, not sure if the row highlight is meant to be on the same row as the controls, or if its intentional that that next row after the controls is highlighted.

Config

-- ~/.config/nvim/lua/plugins/dap.lua
return {
  {
    "mfussenegger/nvim-dap",
    dependencies = {
      "rcarriga/nvim-dap-ui",
      "mxsdev/nvim-dap-vscode-js",
      {
        "microsoft/vscode-js-debug",
        opt = true,
        build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
      },
    },
    config = function()
      local dap = require("dap")
      local dapui = require("dapui")
      dapui.setup()
      dap.listeners.after.event_initialized["dapui_config"] = dapui.open
      dap.listeners.before.event_terminated["dapui_config"] = dapui.close
      dap.listeners.before.event_exited["dapui_config"] = dapui.close

      local lazy_path = vim.fn.glob(vim.fn.stdpath("data") .. "/lazy/")
      require("dap-vscode-js").setup({
        debugger_path = lazy_path .. "vscode-js-debug",
        adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" },
      })
      for _, language in ipairs({ "typescript", "javascript" }) do
        dap.configurations[language] = {
          {
            type = "pwa-node",
            request = "launch",
            name = "Launch file",
            program = "${file}",
            cwd = "${workspaceFolder}",
            -- https://github.com/microsoft/vscode/issues/102042
            resolveSourceMapLocations = {
              "${workspaceFolder}/**",
              "!**/node_modules/**",
            },
          },
        }
      end
    end,
  },
}

I also have one file to patch LazyVim for Neovim 0.9 compatibility:

-- ~/.config/nvim/lua/plugins/treesitter.lua
-- In nvim 0.9, `help` was renamed to `vimdoc`, but `LazyVim` hasn't been updated for that yet.
-- This patch ensures you don't see a warning/error about `help` language stuff not being installed when `nvim` is launched.
return {
  "nvim-treesitter/nvim-treesitter",
  opts = function(_, opts)
    opts.ignore_install = { "help" }
    if type(opts.ensure_installed) == "table" then
      vim.list_extend(opts.ensure_installed, {
        "vimdoc",
      })
    end
  end,
}

@pcattori
Copy link
Author

pcattori commented Apr 7, 2023

Note: I haven't gone through the effort of disabling LazyVim's built-in plugins one-by-one to track down if any of them are interfering here. Nor have I tried to reproduce this without LazyVim installed at all. If I have more time, then I might try to narrow this down further.

rcarriga added a commit that referenced this issue Apr 9, 2023
@rcarriga
Copy link
Owner

rcarriga commented Apr 9, 2023

I was able to reproduce this, it was introduced by a recent refactor. Should be working now 😄

@pcattori
Copy link
Author

pcattori commented Apr 11, 2023

@rcarriga just tested it out, and looks like the controls are redrawing correctly now!


Potentially related: Is it intentional that the highlighted row is below the controls?

Screenshot 2023-04-11 at 10 44 06 AM

Screenshot 2023-04-11 at 10 50 31 AM

I would have expected the row with the controls to be highlighted, not the one after.

@rcarriga
Copy link
Owner

That's not a dapui feature. I believe that's because your Normal highlight (the first line in the buffer) has a different background to EndOfBuffer (the rest of the lines in the window)

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

3 participants