vim-smoothie icon indicating copy to clipboard operation
vim-smoothie copied to clipboard

Handle slow UIs gracefully

Open psliwka opened this issue 5 years ago • 5 comments

Smooth scrolling, due to its nature, causes enormous amount of screen redraws. This is a problem when the redraw operation is particularly slow, f.ex. when running over a low-bandwidth SSH connection, or low-performance RPC pipelines, such as described in #17.

Minimal solution

As a bare minimum, the plugin should allow users to disable smooth scrolling on demand (f.ex. via dedicated variable or command), so that they can help themselves ad-hoc when the UI feels slow.

Optimal solution

Ideally, the plugin would detect as many slow-UI cases as possible, and automatically disable itself till the end of current editing session (or even better, adjust the animation frame rate dynamically to current conditions).

psliwka avatar Aug 14 '20 13:08 psliwka

Detecting redraw speed and adjusting animation rate dynamically seems far outside the scope of what one would expect of a Vim plugin.

Probably a command to turn it on-off should suffice. You can always configure a hotkey for that command or use a separate refresh-rate-detection plugin to call that command.

WhyNotHugo avatar Aug 15 '20 08:08 WhyNotHugo

I have tried to implement the minmal solution @psliwka mentioned in his post above

Please test #21 using the following config -

let g:smoothie_disabled = 1

and report bugs, if any

subnut avatar Nov 18 '20 16:11 subnut

@psliwka We could use the ttyfast option to implement the optimal solution

You agree?


:help ttyfast
                                     *'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
'ttyfast' 'tf'          boolean (default off, on when 'term' is xterm, hpterm,
                                        sun-cmd, screen, rxvt, dtterm or
                                        iris-ansi; also on when running Vim in
                                        a DOS console)
                        global
        Indicates a fast terminal connection.  More characters will be sent to
        the screen for redrawing, instead of using insert/delete line
        commands.  Improves smoothness of redrawing when there are multiple
        windows and the terminal does not support a scrolling region.
        Also enables the extra writing of characters at the end of each screen
        line for lines that wrap.  This helps when using copy/paste with the
        mouse in an xterm and other terminals.

subnut avatar Dec 03 '20 07:12 subnut

@psliwka We could use the ttyfast option to implement the optimal solution

Please correct me if I'm wrong, but ttyfast seems to be always on in current terminal world – almost all terminal emulators are xterm descendants or disguise themselves as such. Neovim devs even deprecated this option completely. Therefore, I doubt its value would carry any information useful for us.

psliwka avatar Dec 25 '20 22:12 psliwka

Hm.... that's true...

But we could instruct the users to set this option when using a slow connection, because this option was meant for that...

:shrug:

subnut avatar Dec 26 '20 03:12 subnut