not quite sure what I've done here
This commit is contained in:
parent
b22873f45f
commit
83aaa5aef3
18 changed files with 392 additions and 392 deletions
|
|
@ -44,72 +44,72 @@ return { "nvim-telescope/telescope.nvim",
|
|||
load = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
local function send_limited_to_qflist_and_open(prompt_bufnr)
|
||||
local picker = action_state.get_current_picker(prompt_bufnr)
|
||||
local entries = {}
|
||||
local max_items = 100
|
||||
local count = 0
|
||||
local function send_limited_to_qflist_and_open(prompt_bufnr)
|
||||
local picker = action_state.get_current_picker(prompt_bufnr)
|
||||
local entries = {}
|
||||
local max_items = 100
|
||||
local count = 0
|
||||
|
||||
for entry in picker.manager:iter() do
|
||||
if count >= max_items then
|
||||
break
|
||||
end
|
||||
for entry in picker.manager:iter() do
|
||||
if count >= max_items then
|
||||
break
|
||||
end
|
||||
|
||||
local filename = entry.path or entry.filename or entry.value
|
||||
local text = entry.text or entry.value
|
||||
if not text then
|
||||
if type(entry.value) == "table" then
|
||||
text = entry.value.text
|
||||
else
|
||||
text = entry.value
|
||||
end
|
||||
end
|
||||
local filename = entry.path or entry.filename or entry.value
|
||||
local text = entry.text or entry.value
|
||||
if not text then
|
||||
if type(entry.value) == "table" then
|
||||
text = entry.value.text
|
||||
else
|
||||
text = entry.value
|
||||
end
|
||||
end
|
||||
|
||||
local pattern
|
||||
if not entry.lnum then
|
||||
if type(entry.display) == "string" then
|
||||
pattern = entry.display
|
||||
elseif type(entry.ordinal) == "string" then
|
||||
pattern = entry.ordinal
|
||||
elseif type(text) == "string" then
|
||||
pattern = text
|
||||
else
|
||||
entry.lnum = 1
|
||||
end
|
||||
end
|
||||
local pattern
|
||||
if not entry.lnum then
|
||||
if type(entry.display) == "string" then
|
||||
pattern = entry.display
|
||||
elseif type(entry.ordinal) == "string" then
|
||||
pattern = entry.ordinal
|
||||
elseif type(text) == "string" then
|
||||
pattern = text
|
||||
else
|
||||
entry.lnum = 1
|
||||
end
|
||||
end
|
||||
|
||||
if filename then
|
||||
table.insert(entries, {
|
||||
filename = filename,
|
||||
text = text,
|
||||
lnum = entry.lnum,
|
||||
col = entry.col,
|
||||
if filename then
|
||||
table.insert(entries, {
|
||||
filename = filename,
|
||||
text = text,
|
||||
lnum = entry.lnum,
|
||||
col = entry.col,
|
||||
|
||||
-- we try and put a pattern in based on the info we receive from
|
||||
-- telescope so that the qf list takes us to the correct place
|
||||
pattern = pattern
|
||||
})
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
-- we try and put a pattern in based on the info we receive from
|
||||
-- telescope so that the qf list takes us to the correct place
|
||||
pattern = pattern
|
||||
})
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
|
||||
if #entries > 0 then
|
||||
-- make sure errors get suppressed. I don't care
|
||||
pcall(vim.fn.setqflist, {}, " ", {
|
||||
title = "Telescope Limited Results",
|
||||
items = entries
|
||||
})
|
||||
end
|
||||
if #entries > 0 then
|
||||
-- make sure errors get suppressed. I don't care
|
||||
pcall(vim.fn.setqflist, {}, " ", {
|
||||
title = "Telescope Limited Results",
|
||||
items = entries
|
||||
})
|
||||
end
|
||||
|
||||
actions.select_default(prompt_bufnr)
|
||||
end
|
||||
actions.select_default(prompt_bufnr)
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
layout_strategy = "bottom_pane",
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
layout_strategy = "bottom_pane",
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close,
|
||||
|
|
@ -119,11 +119,11 @@ return { "nvim-telescope/telescope.nvim",
|
|||
}
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true
|
||||
}
|
||||
},
|
||||
pickers = {
|
||||
colorscheme = {
|
||||
enable_preview = true
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {}
|
||||
}
|
||||
|
|
@ -154,6 +154,6 @@ return { "nvim-telescope/telescope.nvim",
|
|||
}
|
||||
end, { desc = "find files in plugin directory" })
|
||||
|
||||
map("n", "<leader>tt", "<cmd>Telescope<CR>")
|
||||
map("n", "<leader>tt", "<cmd>Telescope<CR>")
|
||||
end
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue