RishabhRD / nvim-cheat.sh

cheat.sh integration for neovim in elegant way
151 stars 8 forks source link

initially displays empty buffer if there is any delay in data #5

Open RishabhRD opened 3 years ago

RishabhRD commented 3 years ago

As @akinsho mentioned in #4

I think it's weird that the floating window opens immediately and is empty, so you wait another 2-3sec for the request to complete. I think it would be better to only open the floating window when the data has come back, or add a loading window.

If there is a delay in data due to some reasons like network issues, etc then we see a blank floating window that is actually waiting for data. This is a little weird behavior.

My intent for this behavior was if data is not available fast and let's say it takes 2-3 seconds to arrive first data then users can quit the floating window even before the data arrives. That would also quit the job in the middle and users can continue working. However, it also means that if we want data to be displayed in any case, we will have to stick with the floating window till the data arrives.

akinsho commented 3 years ago

@RishabhRD I have a plugin I'm working on that has a similar issue i.e. it makes a network request the user has to wait for and the GIF shows how I handle it loading-dep-assist

RishabhRD commented 3 years ago

@akinsho Yeah! I got your idea. Instead of displaying a blank window, we can display some loading thing. That would assure users that there is an ongoing process and they can understand the blank window is due to network delay and not due to some error or something.

I would implement it tomorrow morning maybe. :smiley: