mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-08-06 10:55:00 +02:00
Remove check for nvim-window-picker plugin
This commit is contained in:
parent
adbc11fc1b
commit
4ff106bf7f
1 changed files with 30 additions and 33 deletions
|
@ -108,41 +108,38 @@ return {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
local plugin = require("lazy.core.config").plugins["nvim-window-picker"]
|
--- Opens the file in a picked window.
|
||||||
if plugin then
|
--- @param close boolean Whether to close the mini.files window after opening the file.
|
||||||
--- Opens the file in a picked window.
|
local open_in_window = function(close)
|
||||||
--- @param close boolean Whether to close the mini.files window after opening the file.
|
close = close or false
|
||||||
local open_in_window = function(close)
|
local mini_files = require("mini.files")
|
||||||
close = close or false
|
local picked_window_id = require("window-picker").pick_window({
|
||||||
local mini_files = require("mini.files")
|
filter_rules = {
|
||||||
local picked_window_id = require("window-picker").pick_window({
|
autoselect_one = true,
|
||||||
filter_rules = {
|
bo = {
|
||||||
autoselect_one = true,
|
filetype = { "notify", "minifiles" },
|
||||||
bo = {
|
buftype = { "terminal", "quickfix", "nofile" },
|
||||||
filetype = { "notify", "minifiles" },
|
|
||||||
buftype = { "terminal", "quickfix", "nofile" },
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
if picked_window_id then
|
|
||||||
mini_files.set_target_window(picked_window_id)
|
|
||||||
mini_files.go_in({ close_on_file = close })
|
|
||||||
else
|
|
||||||
vim.notify("Window selection canceled", vim.log.levels.INFO, { title = "mini.files" })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "MiniFilesBufferCreate",
|
|
||||||
callback = function(args)
|
|
||||||
local buf_id = args.data.buf_id
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<M-l>", open_in_window, { buffer = buf_id, desc = "Open file in window" })
|
|
||||||
vim.keymap.set("n", "<M-L>", function()
|
|
||||||
open_in_window(true)
|
|
||||||
end, { buffer = buf_id, desc = "Open file in window and close" })
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
if picked_window_id then
|
||||||
|
mini_files.set_target_window(picked_window_id)
|
||||||
|
mini_files.go_in({ close_on_file = close })
|
||||||
|
else
|
||||||
|
vim.notify("Window selection canceled", vim.log.levels.INFO, { title = "mini.files" })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "MiniFilesBufferCreate",
|
||||||
|
callback = function(args)
|
||||||
|
local buf_id = args.data.buf_id
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<M-l>", open_in_window, { buffer = buf_id, desc = "Open file in window" })
|
||||||
|
vim.keymap.set("n", "<M-L>", function()
|
||||||
|
open_in_window(true)
|
||||||
|
end, { buffer = buf_id, desc = "Open file in window and close" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue