xiota / geany-preview

Turns Geany into a markdown editor by providing a preview pane in the sidebar to show the formatting of several light-weight languages as they are edited. Supported document types include AsciiDoc, DocBook, Fountain, HTML, LaTeX, Markdown, MediaWiki, reStructuredText, Textile, and Txt2Tags.
GNU General Public License v3.0
12 stars 0 forks source link

"Loading." for two seconds after every restart of Geany #17

Closed ralf3u closed 2 years ago

ralf3u commented 2 years ago

actual behavior After every restart of Geany there is for about two seconds the text Loading. in the content of the Preview-tab, even if only one tab is open in the editor, and even there is only one letter in the document, is it txt, md or html.

expectation It would be good if the content of an open tab would appear faster in the Preview-tab.

possible solution If Geany is open and then if I open a document like txt, html or md, then the document is shown right away. So the problem seems to be not the rendering. Maybe something does not work properly when Geany is restarted or there is too much to load, like the load of all parsers. So, what about this idea: Geany Preview should do this after every restart of Geany:

xiota commented 2 years ago

The webview initializes on a few signals.

The problem is on startup, the document isn't ready or the document signals aren't sent. So it falls back to the timeout.

I'll add an option to change the timeout in a future version.

xiota commented 2 years ago

Default timeout changed to 350ms in 09069a8d7f55856a852181f38770b6b71a5d63ef. Can be changed in preview.conf. PPA will be updated.

ralf3u commented 2 years ago

Default timeout changed to 350ms in 09069a8. Can be changed in preview.conf. PPA will be updated.

Oh!! That's cool! Thank you so much for this feature.