fix: Don't push past midnight. You'll make clason's stuff break :/

This commit is contained in:
TJ DeVries
2020-09-04 09:49:10 -04:00
parent 996f69465e
commit 14310ee6b1
9 changed files with 352 additions and 223 deletions
+11 -1
View File
@@ -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 ~= "",