Skip to content

Commit

Permalink
fix(quickfix): handle multi-line entries more like the quicklist window
Browse files Browse the repository at this point in the history
That means having them displayed without new lines so that they are
concatenated into on one long line. Prior to these changes if a quickfix
entry included newlines those would become separate entries in the fzf
selection list. Quickfix entries are formatted so they start with the
file name and location, but only the first line is like that, so if one
were to select one of the other lines from an entry the start of this
line would be interpreted as a file name and would open a buffer "there"
  • Loading branch information
johslarsen authored and ibhagwan committed Mar 2, 2024
1 parent ab4ce50 commit 594e7ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/fzf-lua/providers/quickfix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local quickfix_run = function(opts, cfg, locations)

for _, entry in ipairs(locations) do
if entry.valid == 1 or not opts.only_valid then
entry.text = entry.text:gsub("\r?\n", " ")
table.insert(results, make_entry.lcol(entry, opts))
end
end
Expand Down

0 comments on commit 594e7ab

Please sign in to comment.