mikavilpas / yazi.nvim

A Neovim Plugin for the yazi terminal file manager
MIT License
400 stars 12 forks source link

delayed response when closing yazi #237

Closed Ben-PH closed 2 weeks ago

Ben-PH commented 1 month ago

When closing with either a file selecton, or hitting Q, there's a brief delay. This is my yazi.lua, using lazy.nvim, with nushell as my default shell:

---@type LazySpec
return {
  "mikavilpas/yazi.nvim",
  event = "VeryLazy",
  keys = {
    -- 👇 in this section, choose your own keymappings!
    {
      "<leader>-",
      function()
        require("yazi").yazi()
      end,
      desc = "Open the file manager",
    },
    {
      -- Open in the current working directory
      "<leader>cw",
      function()
        require("yazi").yazi(nil, vim.fn.expand('%:p:h'))
      end,
      desc = "Open the file manager to directiory of file backing current buffer" ,
    },
    {
      '<c-up>',
      function()
        -- NOTE: requires a version of yazi that includes
        -- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
        require('yazi').toggle()
      end,
      desc = "Resume the last yazi session",
    },
  },
  ---@type YaziConfig
  opts = {
    -- if you want to open yazi instead of netrw, see below for more info
    open_for_directories = false,

    -- enable these if you are using the latest version of yazi
    use_ya_for_events_reading = true,
    use_yazi_client_id_flag = true,
  },
}
mikavilpas commented 1 month ago

Hi, could you send a video clip demonstrating the delay?

mikavilpas commented 1 month ago

Just tried to replicate this with SHELL=$(which nu) nvim which seems to set nushell as the default shell temporarily. Unfortunately I don't see any slowness myself

https://github.com/user-attachments/assets/e07ec80f-cf52-4b3e-8992-e6fc78900820

Ben-PH commented 1 month ago

delay.webm

the first close isn't immediate tap of Q, but the second one is a j immediately followed by ret, i.e. if there was no delay, there would be no pause over bufferline.lua before the window closes.

This is a new from-scratch setup (moving over from packer, and looking for a fresh start), so it's plausible this is purely an issue on my side. By the same token, this is both the first time tryng yazi.nvim, and seeing a delay such as this. If this isn't a low-hanging-fruit issue, we can idle on it for awhile, at least until I get more familiar with my setup and can say with a touch of confidence the likely culprit is.

Later on, I'll publish my config, and if you cannot reproduce, then that will solidly point towards it being my environment.

mikavilpas commented 1 month ago

Ok, sounds good! There's also an issue reproduction setup available where you can define a minimal neovim config and then play around with it.

https://github.com/mikavilpas/yazi.nvim/blob/main/documentation/reproducing-issues.md

Ben-PH commented 2 weeks ago

...so I installed a more recent nvim, and did some other fiddling around, and it's now fully responsive. Didn't change anything about my yazi.nvim setup, so this tells me its a me-issue. As far as I'm concerned, this issue no longer needs to be be open.