rogual / neovim-dot-app

Mac OS X GUI for Neovim
1.13k stars 62 forks source link

Add GUI scroll bars #294

Open kiryph opened 7 years ago

kiryph commented 7 years ago

One of the reasons I am interested in using (N)VIM in a gui window instead of using it in the terminal is a useful scroll bar (probably next to cmd+x/c/v integrating into vim's default yank/paste mechanism).

I know that I can use the mouse wheel, but a scroll bar provides much more feedback about document length and current location of the view related to the complete file.

IMHO, this should be a priority feature.

Other nice features of MacVim are support for 'transparency' and OSX 'Find Pasteboard', a feature I suppose most people do not know which, however, can be sometimes convenient (https://github.com/macvim-dev/macvim/blob/master/runtime/doc/gui_mac.txt#L121-L135).

rogual commented 7 years ago

Tricky. We'd need to get Neovim to leave extra space to the side of each split for the scrollbar, and be able to efficiently query scroll positions of each visible buffer, and where their split windows are in the main window.

AFAIK Neovim doesn't have support for this kind of thing right now.

rogual commented 7 years ago

The “Find Pasteboard” sounds interesting. I didn't know about that. If you open a separate issue for that it's a lot more likely to get resolved sometime soon than this one :)

kiryph commented 7 years ago

Thanks for your quick response.

Too bad that neovim does not support this in a convenient way. This actually looks like a step back by neovim. I was expecting that neovim makes it easier for front ends.

I have created a separate issue regarding the 'Find Pasteboard' (see #295 )

roryokane commented 7 years ago

Tricky. We'd need to get Neovim to leave extra space to the side of each split for the scrollbar, and be able to efficiently query scroll positions of each visible buffer, and where their split windows are in the main window.

The MacVim GUI avoids this problem by reserving space for scroll bars only in two columns on the very left and right of the window. See this screenshot:

MacVim scroll bars demonstration

You can see that if there are horizontal splits, MacVim puts multiple scroll bars in the column, forming rows. And in the above example, MacVim uses both the left and right columns because there are vertical splits. When there are no vertical splits, it uses only the right column.

In the example there are three splits in the same row, but only two columns to put them in. In this case, MacVim looks at the horizontal position of the currently focused window (the middle-bottom one in the example), and assigns the scroll bar in the closest column (the right column) to it. Then the other column’s (left column’s) scroll bar handles the closest (leftmost) window in that row.

MacVim’s scheme is not a perfectly natural use of scroll bars, but it is far better than having no scroll bars at all, and it can be implemented while still giving Vim control over the whole character display. The edge cases with splits come up rarely – if there are no splits, the scroll bar works like you’d expect it to.

ghost commented 5 years ago

Any updates on this feature develop ? I would also expect to have the scroll bar, especially the right side scroll bar.