Skip to content

Commit

Permalink
fix: swapfile bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed May 31, 2024
1 parent 72da6e0 commit f80489b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/neorg/modules/core/dirman/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,14 @@ module.on_event = function(event)
end
end

vim.cmd.edit(index_path:cmd_string())
local ok, _ = pcall(vim.cmd.edit, index_path:cmd_string())
if not ok then
log.warn(
("Failed to edit file %s. This can result from vim finding a swapfile. If that was the case, ignore this warning."):format(
index_path
)
)
end
return
end

Expand Down

0 comments on commit f80489b

Please sign in to comment.