fix(view): strip newlines from symlink target display text
Problem: when a symlink target path contains a newline character, the
rendered line passed to nvim_buf_set_lines includes that newline,
causing the error "'replacement string' item contains newlines".
Solution: apply the same gsub("\n", "") sanitization to meta.link in
get_link_text that is already used for entry names at line 791.
Resolves: stevearc/oil.nvim#673
This commit is contained in:
parent
ca834cf703
commit
9110a1a499
1 changed files with 1 additions and 1 deletions
|
|
@ -760,7 +760,7 @@ local function get_link_text(name, meta)
|
|||
end
|
||||
|
||||
if meta.link then
|
||||
link_text = "-> " .. meta.link
|
||||
link_text = "-> " .. meta.link:gsub("\n", "")
|
||||
if meta.link_stat and meta.link_stat.type == "directory" then
|
||||
link_text = util.addslash(link_text)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue