From 5f473263b90b8b0e1b36ea87dac1687924c73959 Mon Sep 17 00:00:00 2001 From: Mark Oborne Date: Fri, 24 Jun 2022 21:35:13 +0100 Subject: [PATCH] fix(quickfix): prevent indexing opts when nil `opts` was being used before it was normalized causing the quickfix command to fail when used without any options. --- lua/fzf-lua/providers/quickfix.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/fzf-lua/providers/quickfix.lua b/lua/fzf-lua/providers/quickfix.lua index e0f64ee..8aa2a93 100644 --- a/lua/fzf-lua/providers/quickfix.lua +++ b/lua/fzf-lua/providers/quickfix.lua @@ -7,16 +7,17 @@ local M = {} local quickfix_run = function(opts, cfg, locations) if not locations then return {} end local results = {} - for _, entry in ipairs(locations) do - table.insert(results, core.make_entry_lcol(opts, entry)) - end opts = config.normalize_opts(opts, cfg) if not opts then return end if not opts.cwd then opts.cwd = vim.loop.cwd() end - local contents = function (cb) + for _, entry in ipairs(locations) do + table.insert(results, core.make_entry_lcol(opts, entry)) + end + + local contents = function(cb) for _, x in ipairs(results) do x = core.make_entry_file(opts, x) if x then