Olical / nfnl

Enhance your Neovim with Fennel
The Unlicense
235 stars 8 forks source link

Prevents to open Fugitive diff #3

Closed nbardiuk closed 1 year ago

nbardiuk commented 1 year ago

When I try to open a fugitive diff of a fennel file I get an error .../.nfnl.fnl is not trusted, refusing to compile.

Steps to reproduce

Expected - 2 buffers side by side comparing the indexed version of the file with the unstaged version Actual - error .../.nfnl.fnl is not trusted, refusing to compile. and only one buffer opens with the local version

More details

The indexed version of the file has a path fugitive://{a}/.git//0/{b}/init.fnl where {a} is the absolute path to the git folder on my machine and {b} path inside my git repo. Looks like the corresponding fugitive://{a}/.git//0/{b}/.nfnl.fnl is not trusted.

Suggestions

Would it be possible to have a way to ignore some configuration files without a prompt? A regular expression would be great, or a predicate function.

Alternatively, the message about untrusted .nfnl.fnl could be a warning, not an error.

Olical commented 1 year ago

Hm, that error is sent to vim.notify as an error, but that shouldn't interrupt anything, it's still just a notification.

And you're right it looks like it's the fugitive::// part of the path that's confusing things, maybe I'll opt the autocmd out of running for buffers that start with xyz://. That might resolve the issue nicely.

Olical commented 1 year ago

Pushed a fix that should ignore these protocol prefixed buffers. I hope this does the trick!

nbardiuk commented 1 year ago

Yes, it does the trick. Thank you!