mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
feat(telescope): smarter way to determine the window to open a file in
This commit is contained in:
parent
5d44c976a7
commit
c0ce89fe62
1 changed files with 13 additions and 0 deletions
|
@ -201,6 +201,19 @@ return {
|
|||
defaults = {
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
-- open files in the first window that is an actual file.
|
||||
-- use the current window if no other window is available.
|
||||
get_selection_window = function()
|
||||
local wins = vim.api.nvim_list_wins()
|
||||
table.insert(wins, 1, vim.api.nvim_get_current_win())
|
||||
for _, win in ipairs(wins) do
|
||||
local buf = vim.api.nvim_win_get_buf(win)
|
||||
if vim.bo[buf].buftype == "" then
|
||||
return win
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-t>"] = open_with_trouble,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue