tigion / nvim-asciidoc-preview

A simple AsciiDoc preview while editing AsciiDoc documents in Neovim
MIT License
33 stars 3 forks source link

Feature request: update the preview as I type #6

Open refaelsh opened 3 months ago

refaelsh commented 3 months ago

Currently, the preview updates when I save the file. Can you please make it so that it will update when I type? Without the need to save? Thank you :-)

jirafey commented 2 months ago

is this planned?

tigion commented 2 months ago

Not at the moment. But it's not forgotten. ☕️

Long story:

Currently, the entire website is reloaded when saving, which currently has a negative impact on performance every time a change is made. That is why this option is currently not available.

It was more important to me to update the preview when saving as a first step. This is also how I use it.

I have an older extra branch to switch to the hopefully better performing web sockets for the preview. However, this is just a first concept and I already have a few ideas for implementation. But I don't have the time at the moment.

brianhuster commented 1 week ago

You can use this plugin autosave.nvim. It will save the file as you type, so the browser will reload when it is updated.

However, I think the Asciidoctor.js library is kinda slow (at least when comparing to marked.js for Markdown), which may makes you uncomfortable when using with autosave.nvim. But anyway you can give it a try, and reply to my comment here if there is a problem

refaelsh commented 1 week ago

Ok. I just tried it, it's a bit slow to respond, but enough for me.

P.S. This autosave.nvim plugin is great in general. I was not aware of it. Thank you!