When commenting or uncommenting a read-only file I get the error:
Error detected while processing function NERDComment..<SNR>50_InvertComment..<SNR>50_UncommentLines..<SNR>50_UncommentLinesNormal:
line 4:W10: Warning: Changing a readonly file
Press ENTER or type command to continue
The error should be caught and a cleaner message displayed, like the standard one Vim issues:
-- INSERT -- W10: Warning: Changing a readonly file
you might ask why i'd be editing a readonly file- I frequently edit system files as myself and when ready, call sudo from within vim.
You can add "silent" to all the setline calls to completely silence the error/warning messages. I don't know of a way to hide just the errors though and still echo warnings.
When commenting or uncommenting a read-only file I get the error:
The error should be caught and a cleaner message displayed, like the standard one Vim issues: