rhysd / NyaoVim

Web-enhanced Extensible Neovim Frontend
Other
2.22k stars 57 forks source link

neovim-editor component freezes when a plugin has an uncaught error #117

Open htzh opened 7 years ago

htzh commented 7 years ago

I am writing a plugin that uses Katex to preview math formulas. What I found is that when Katex throws a uncaught error the editor also freezes. This was solved by catching what Katex threw. However it is unsettling that the editor would freeze from a plugin error.

Expected Behavior

When a plugin has an exception, the plugin may stop working. However the editor should be able to continue to allow the user to save the work and restart, if necessary.

Actual Behavior

The editor component also stops working when a plugin throws.

Steps to Reproduce (including precondition)

Throw a uncaught exception in a plugin function. Use rpcnotify to trigger the said function.

Screenshot on This Problem (if possible)

Your Environment

Additional Comments (if any)

The UI is not frozen. Chrome debugger works fine. That is how I found out it was an uncaught exception. It is possible that the reload through the UI menu could have worked.