fix: handle files with newlines in the name (#534)
This commit is contained in:
parent
7a55ede5e7
commit
dba0375988
2 changed files with 4 additions and 0 deletions
|
|
@ -82,6 +82,8 @@ M.show = vim.schedule_wrap(function(actions, should_confirm, cb)
|
||||||
else
|
else
|
||||||
line = adapter.render_action(action)
|
line = adapter.render_action(action)
|
||||||
end
|
end
|
||||||
|
-- We can't handle lines with newlines in them
|
||||||
|
line = line:gsub("\n", "")
|
||||||
table.insert(lines, line)
|
table.insert(lines, line)
|
||||||
local line_width = vim.api.nvim_strwidth(line)
|
local line_width = vim.api.nvim_strwidth(line)
|
||||||
if line_width > max_line_width then
|
if line_width > max_line_width then
|
||||||
|
|
|
||||||
|
|
@ -734,6 +734,8 @@ M.format_entry_cols = function(entry, column_defs, col_width, adapter, is_hidden
|
||||||
if meta and meta.display_name then
|
if meta and meta.display_name then
|
||||||
name = meta.display_name
|
name = meta.display_name
|
||||||
end
|
end
|
||||||
|
-- We can't handle newlines in filenames (and shame on you for doing that)
|
||||||
|
name = name:gsub("\n", "")
|
||||||
-- First put the unique ID
|
-- First put the unique ID
|
||||||
local cols = {}
|
local cols = {}
|
||||||
local id_key = cache.format_id(entry[FIELD_ID])
|
local id_key = cache.format_id(entry[FIELD_ID])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue