mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
fix: Don't push past midnight. You'll make clason's stuff break :/
This commit is contained in:
@@ -28,7 +28,7 @@ function make_entry.gen_from_string()
|
||||
return function(line)
|
||||
return {
|
||||
valid = line ~= "",
|
||||
entry_type = make_entry.types.SIMPLE,
|
||||
entry_type = make_entry.types.GENERIC,
|
||||
|
||||
value = line,
|
||||
ordinal = line,
|
||||
@@ -40,6 +40,8 @@ end
|
||||
function make_entry.gen_from_file(opts)
|
||||
opts = opts or {}
|
||||
|
||||
local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd())
|
||||
|
||||
local make_display = function(line)
|
||||
local display = line
|
||||
if opts.shorten_path then
|
||||
@@ -58,6 +60,7 @@ function make_entry.gen_from_file(opts)
|
||||
|
||||
entry_type = make_entry.types.FILE,
|
||||
filename = line,
|
||||
path = cwd .. '/' .. line,
|
||||
}
|
||||
|
||||
entry.display = make_display(line)
|
||||
@@ -101,6 +104,13 @@ function make_entry.gen_from_vimgrep(opts)
|
||||
-- Or could we just walk the text and check for colons faster?
|
||||
local _, _, filename, lnum, col, text = string.find(line, [[([^:]+):(%d+):(%d+):(.*)]])
|
||||
|
||||
local ok
|
||||
ok, lnum = pcall(tonumber, lnum)
|
||||
if not ok then lnum = nil end
|
||||
|
||||
ok, col = pcall(tonumber, col)
|
||||
if not ok then col = nil end
|
||||
|
||||
return {
|
||||
valid = line ~= "",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user