triptych.nvim
triptych.nvim copied to clipboard
Error when trying to delete file/folder
Bug description Delete a file/folder in triptych window give the following error, regardless the file being open or not:
Error executing vim.schedule lua callback: ...cal/share/nvim/lazy/triptych.nvim/lua/triptych/float.lua:67: Invalid window id: 1002
stack traceback:
[C]: in function 'nvim_win_call'
...cal/share/nvim/lazy/triptych.nvim/lua/triptych/float.lua:67: in function 'win_set_title'
...ocal/share/nvim/lazy/triptych.nvim/lua/triptych/view.lua:264: in function 'set_primary_and_parent_window_targets'
...ocal/share/nvim/lazy/triptych.nvim/lua/triptych/view.lua:467: in function 'refresh_view'
...ocal/share/nvim/lazy/triptych.nvim/lua/triptych/init.lua:105: in function 'refresh_view'
...l/share/nvim/lazy/triptych.nvim/lua/triptych/actions.lua:32: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Steps to reproduce
- Open triptych
- Delete a file or folder by pressing d
Setup
- Operating system: Ubuntu 24.04
- Nvim version: 0.10.0
- Triptych config
return {
"simonmclean/triptych.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("triptych").setup({
mappings = {
show_help = "g?",
jump_to_cwd = ".", -- Pressing again will toggle back
nav_left = "h",
nav_right = { "l", "<CR>" }, -- If target is a file, opens the file in-place
open_hsplit = { "-" },
open_vsplit = { "|" },
open_tab = { "<C-t>" },
cd = "<leader>cd",
delete = "d",
add = "a",
copy = "c",
rename = "r",
cut = "x",
paste = "p",
quit = "q",
toggle_hidden = "<leader>.",
},
extension_mappings = {
["<C-f>"] = {
mode = "n",
fn = function(target, _)
require("telescope.builtin").live_grep({ search_dirs = { target.path } })
end,
},
},
})
vim.keymap.set("n", "<leader>t", "<cmd>Triptych<CR>", { desc = "Toggle Triptych", silent = true })
end,
}
I am having the same problem and I think it's because I'm using the telescope ui-select extension, which seems to close the triptych window when it opens. When I remove that plugin it works correctly
I've merged a change which should fix this. Let me know how it goes
It's working for me! Thanks