joethei / obsidian-link-favicon

See the favicon for a linked website.
GNU General Public License v3.0
89 stars 3 forks source link

Very visible buffering in live preview #22

Closed NomarCub closed 2 years ago

NomarCub commented 2 years ago

Icons in live preview load in in a very visible, jarring way, also with some delay from one to the next. In addition it buffers every time you scroll up and down past a certain (kind of small) threshold, and even reloads icons that were already there. I tried this offline with caches too.

difff

Is this just the nature of Obsidian's live preview? Even if so there might be some ways to make it smoother. Does the plugin load the icons from memory, or from file caches directly? Could there be a way to load all icons at the same time upon scrolling?

On another note, thank you very much for your work on this plugin ♥ I'm really grateful for your continuous development and bugfixing, and satisfying my and other people's every whim.

joethei commented 2 years ago

This is mainly due to the way Decorations are implemented in CodeMirror(The underlying editor for obsidian). I cannot do anything about the reloading of icons. Icons are always loaded from disk, and I also cannot do anything to get these from memory, due to some constraints with the implementation of #5.

The time it takes to load up is the same value that is also responsible for the time it takes between you stopping to edit, and the icon being shown. I have this as a setting in the advanced section(all the way at the bottom), that you can play with.(Don't set the value to low, or you will run into #16 again) I have also decreased the default value for that a bit in this update(1.7.1)

NomarCub commented 2 years ago

Thanks! In that case I'll take updating while editing over loading slower.

If the loading from disk implementation constraint can be worked around, and the debouncing in the active, edited line can be separated from debouncing in general loading I may try to contribute at a later date.