lornix / vim-scrollbar

An attempt to display a scrollbar with 'thumb' in curses-based vim. Uses the 'sign' feature of vim to display a scrollbar on the left-hand side.
47 stars 12 forks source link

Slow #2

Closed Koshmaar closed 8 years ago

Koshmaar commented 9 years ago

I tried it on babun (cygwin based windows console) in bash, windows 8, and it made the scrolling of window veeery slow... unbearably slow.

Also, the scrollbar didn't update when I was scrolling using mouse wheel.

Nice idea, though implementation needs some love :)

samliu commented 9 years ago

I added a simple performance enhancer, seems to work OK on my os x right now, let me know if it's still slow for you.

I tried seeing if there was a vim eventlistener for when the current view of the buffer changes, but couldn't find one. So for now it will run the function with every cursor move; it'll just skip redrawing when it doesn't need to. (It used to redraw the bar every cursor move)

ejoubaud commented 9 years ago

Pretty slow for me on a MacBook Pro: when I hold j or k for a bit, the scrolling will lag quite a bit, especially in tmux. Improves dramatically when I toggle the sidebar off.

(PS: Awesome work on this plugin though, this is exactly what I needed to avoid getting lost in my buffers)

nadimkobeissi commented 8 years ago

Indeed, very slow for me. It's a great plugin though.

Setup: MacBook, Terminal.app, tmux

samliu commented 8 years ago

Thanks for the feedback. I'm actually at a loss for how to make it faster at this point...we might just be limited by the triggers provided by vim's API.

If anyone finds a way to make it faster please feel free to send a pull request! :)

So, the way I use it now is I leave it off by default but hook in the shortcut to turn it on when I want to see my place on the page (this is for large files). It works OK for small files it seems, but it's also not as useful in those cases. It also seems to have some weird behavior in split panes :/ smh

Mehradzie commented 8 years ago

The same here on VIM @ Ubuntu Server. The moment you git the part of the code which the scroll-bar needs to update, it goes to comma :) It is a great work though. I would like to see it working.

samliu commented 8 years ago

Anyone wanna check if this is faster now? It seems better for me!

I commented out a portion of the script that would refresh the calculations for every cursor move. Instead, whenever you use movement keys (up down, j, k, ctrl-e, ctrl-y, ctrl-f, ctrl-b) it refreshes the scrollbar.

samliu commented 8 years ago

Note: the faster update doesn't work with mouse wheel. I suspect you shouldn't use a mouse wheel with vim, or you should just rely on macvim/gvim/windows vim to do it for you.

Closing this bug until someone complains again. Feel free to reopen if your performance issues haven't been addressed!

mzavoloka commented 8 years ago

Freakingly slow when holding h or j. This goes beyond all decency. Uninstalled. But watch this repo.

samliu commented 8 years ago

Do you mean holding j or k? There shouldn't be a keybinding for h since that's "move back within a line."

mzavoloka commented 8 years ago

yes, k, typo

lornix commented 8 years ago

Just so everyone knows, this plugin was more of a "you can't do that" ... "oh really?" kind of thing. It's not optimized for use, not tweaked for speed. It's a proof of concept for a thumb/page indicator in the TEXT only vim. I'm basically abusing the error gutter mechanism, and it's not pretty. But it did shut up the "you can't do that" person. {Grin}

If you want an indicator, I'd really recommend using the GUI version of vim. I'm old school, I ssh, telnet and minicom/serial into everything with text only interfaces, and GUI is far too slow. (and often too much 'chrome' for the devices I tinker on). (How old school? I know how to use 'ed' (and edlin!) and can rattle off working tar commands

You're always welcome to fork it and make it super-snazzy. But you're bikeshedding things at this point.

Neightro commented 4 years ago

If anyone is having issues with this plugin running slowly, I would suggest using set scrolljump=n, where n is a number of your choosing. This property controls the number of lines the cursor will scroll when the cursor goes offscreen, defaulting to 1. The manual notes that this property is specifically intended for terminals that scroll slowly, so it will probably help during use of this plugin.

As a side note, it might be worth making a note about this in the readme so that this information is available to everyone using the plugin.