Closed isvicy closed 2 months ago
Thanks, I think this is a good idea. I think it might need a bit more before it can be merged: I noticed that if I click outside of the yazi modal, the window stays up but its contents (yazi in the terminal) are now killed.
I don't think many people will have this issue, but it would be easier for me to solve that at the same time as this. I will do some more testing hopefully today.
Note to myself: also there seem to be some issues when opening a file in a new split with this change. It can probably be solved though.
Ok I refactored the window implementation a bit. Now it should try to safely close when focus is lost - previously I guess sometimes one of the buffers was already closed due to your other plugin having its own autocommands (not really sure)
Can you try this implementation out?
Ah never mind, it doesn't work yet. Let me try again.
Oh it actually does work, the reproduction file just ran the unfixed code. Here's an updated one that targets this branch (in your fork). You might be able to automatically update it with nvim -u repro.lua -c "lua require('lazy').update()"
. If that doesn't work then you have to call :Lazy
and use the ui to U
pdate, etc.
```lua
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify('./.repro', ':p')
-- set stdpaths to use .repro
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end
-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
vim.g.mapleader = ' '
-- install plugins
local plugins = {
'folke/tokyonight.nvim',
{
'ak2kay/yazi.nvim',
branch = 'fix-window',
dependencies = {
'nvim-lua/plenary.nvim',
},
event = 'VeryLazy',
keys = {
{
-- 👇 choose your own keymapping
'
That's very kind and nice of you!
I can confirm my config is working as expected with your refactoring.
Awesome! It was a great excuse to refactor a bit. Plus, I think the reproduction environment will be useful in the future 👍🏻
mainly fixes #36
in my case, there are two problems i met: