nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.08k stars 202 forks source link

fix: supress swap file errors #1456

Closed benlubas closed 2 weeks ago

benlubas commented 3 weeks ago

1451 caught an error caused by swap files and produced an error message that heavily suggested the error was caused by swap and could be ignored when that was never confirmed. Some concern was raised about this approach, and an additional cases of the same bug was found...

So this PR checks the error message (via pattern match) to confirm that a swap error was the cause of vim.cmd.edit failing, and in these cases eats the error message. It's okay (and I'd say preferred) to eat this error b/c a lengthy swap message will pop up on screen for the user, so users will not be confused about what's happening.

In case the error is not caused be swap, it's now re-raised with the exact error message.

1451 handled the edit call in :Neorg index, this pr additionally handles a call in the hop module when following a link that's opened in nvim.