Escape file name for file to edit
Use `fnameescape` before trying to edit a file when you open it through a link.
This commit is contained in:
parent
bd2481d41e
commit
c9e490e042
2 changed files with 7 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ function A.open(link)
|
|||
if not link or not link.ref then return end
|
||||
local fname = f.get_zettel_by_anchor(link.anchor) or
|
||||
f.get_zettel_by_ref(link.ref) or link.ref
|
||||
vim.api.nvim_command(string.format("edit %s", fname))
|
||||
vim.api.nvim_command(string.format("edit %s", vim.fn.fnameescape(fname)))
|
||||
end
|
||||
|
||||
-- Gets the input at the current buffer cursor and opens it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue