Coder Social home page Coder Social logo

dstein64 / nvim-scrollview Goto Github PK

View Code? Open in Web Editor NEW
489.0 4.0 9.0 1.66 MB

A Neovim plugin that displays interactive vertical scrollbars and signs.

License: MIT License

Lua 87.45% Python 0.65% Vim Script 11.90%
neovim scrollbar scrollview vimscript

nvim-scrollview's Introduction

nvim-scrollview's People

Contributors

ac130kz avatar dstein64 avatar kusti8 avatar lewis6991 avatar maujim avatar ofseed avatar strayer avatar wookayin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nvim-scrollview's Issues

Latest code causes error on startup

Just updated to the latest version, it shows error on every launch.

err

And when install with vim-plug, the tip from the installation section is Plug 'dstein64/nvim-scrollview' which doesn't work, only works with Plug 'dstein64/nvim-scrollview', { 'branch': 'main' }, maybe should be updated in README.

low performance with large file

When opening a log file in 2.2mb with 60000 lines, all scroll operations become very lag, such as mouse scroll, or scroll by some plugins like psliwka/vim-smoothie.

Is it possible to improve the performance ?

Thanks.

False floating detection using coc.nvim

I'm using coc.nvim, and after this commit, the floating window detection is not working properly.

minimal vimrc

syntax enable
filetype plugin indent on

call plug#begin(stdpath('data') . '/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'dstein64/nvim-scrollview'
call plug#end()

" https://github.com/neoclide/coc.nvim/blob/473668eabee0592e817f9c692b0509c2743fb1c3/Readme.md#L217-L222
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"

Steps to reproduce

  1. Open a file that displays scroll bars.
  2. split horizontally (:sp) <- important this step! not split and vsplit work well.
  3. scroll window <C-f>

Vim not supported

The code was originally implemented for Vim, then ported to Neovim, due to complications present on Vim, but not Neovim. These issues are documented here. It may be possible to work around these issues, adding back support for Vim.

Neovim has a WinScrolled event for when a window scrolls. There is an open issue to add similar functionality to Vim. Even with WinScrolled in Neovim, it was still necessary to capture a few additional events for handling window closing, new windows, pasted text, and other scenarios that would require scroll bar updates: TextChanged, WinNew, WinEnter.

Without WinScrolled, the following Vim events could be used to approximately reach the desired behavior.

  • TextChanged
  • TextChangedI
  • WinNew
  • WinEnter
  • VimResized

However, scroll bars were not working properly with some movements, including <ctrl-e>, <ctrl-y>, zb, zt, and zz, and for window resizing (<ctrl-w>+, <ctrl-w>=, etc.). Additionally, splitting a window vertically, and then closing the other window (by pressing <ctrl-w>o from the active window) would not result in a scrollbar update, thus leaving a scrollbar in the middle of the screen.

Neovim has a setting for adding window transparency. This is useful for when a scrollbar overlaps a buffer's text. To work around, I originally tried adding the overlapped text to the popup window's buffer.

  let l:text = ''
  for l:i in range(l:height)
    " A screen redraw is necessary for characters to take their places prior
    " to calling screenstring.
    redraw
    echom screenstring(l:line, l:col)
    let l:text .= screenstring(l:line + l:i, l:col)
  endfor

However, this approach became problematic for scenarios where the scrollbar wasn't properly updated (e.g., <ctrl-e>), as the text shown on the scrollbar would become stale.

E444: Cannot close last window

Steps to reproduce

Minimal .vimrc:

" ~/vimrc_minimal
call plug#begin('~/.local/share/nvim/plugged')
Plug 'dstein64/nvim-scrollview'
call plug#end()

Run the following:

mkdir -p root/subdir
cd root
touch a subdir/b
vim -u ~/vimrc_minimal

Inside vim, execute the following:

:e a<CR>
:e subdir/b<CR>
200OHello, world!<Esc>
:w<CR>
:bd<CR>

We should now see the error message:

E444: Cannot close last window
E444: Cannot close last window
Press ENTER or type command to continue

Window flickers when the window is resized with the mouse

Steps to reproduce:

  1. Open a document.
  2. Move the cursor down so that the top line is no longer line 1 (e.g., using <c-f>).
  3. Split the window with :split or <c-w>s.
  4. Make the bottom window active with :wincmd j or <c-w>j.
  5. Resize the windows by dragging the status line (requires that 'mouse' is set accordingly).
mouse_window_resize_flicker.mp4

Account for folds

The current functionality does not consider that there may be folds enabled for a window's buffer.

Such functionality may benefit from a Lua implementation, for speed, since as far as I can tell, this functionality would require looping over all lines in each buffer to determine where the folds are (I didn't see anything in the api.txt or eval.txt that suggests otherwise). As this may slow down responsiveness, this will likely be optional functionality.

This Issue is based on a comment on Reddit.

Make to scroll character customizable

I would like to make it more modern and replace default '█', character with eg `|' to get more modern look:
image
People using patched fonts could use more fancy characters...
exposing this parameter for customization would be great.

Scrollbar dragging not working when active window is in terminal-job mode

There are no scrollbars shown in terminal windows, but it's possible to drag other windows' scrollbars while the terminal window is active.

From terminal-normal mode, dragging other scrollbars works fine.

From terminal-job mode, incorrectly positioned scrollbars appear when dragging another window's scrollbar. The incorrect scrollbars appear in the same columns where scrollbars would ordinarily appear.

terminal_job.mp4

Possible to support mouse dragging?

Hi, when using this great plugin, I always trying to drag the bar with mouse, and then I realize it is view-only :) Is it possible to support mouse dragging?

Thanks.

Unintended scrolling

To reproduce:

  • Open a file.
  • Run :Git blame.
  • Scroll down.
  • Split the file window.
simplescreenrecorder-2022-03-14_21.12.06.mp4

Account for "virtual" lines after EOF

Hi @dstein64 thanks for making this plugin.

It would be nice to have a configuration option that allows accounting for extra scrolling lines after end of file. This way we can have a bit smaller scroll bar.

This is how VSCode show's this:

Screen Shot 2021-12-02 at 11 17 15 AM

Here's the same file open in a window about the same size as the previous VSCode one.

image

I've noticed in general nvim-scrollview renders pretty big bars, of course this is most notable in small files.

:windo affects scrollview windows

Hi,
I find this plugin very useful and mature.

One issue I'm having is that the :windo command applies to the scrollview windows as well.
(e.g., I cannot use :windo diffthis)

Can this issue be fixed?

creates a conflict when used with coc

The bug seems to occur when I want to do a go to definition from one file to another

I can reproduce the bug consistently:

I use Coc for lsp features, the bug was reproduced with neovim 0.5.1 and 0.6.0 with the latest coc

  1. I go to where the definition is

image

  1. then I go to where this is used in the code (another file)
    image

  2. I do gd (mapping for go to definition) and it works, it does jump to the definition
    image

  3. now in that same file, I go to the bottom of the file, as you can see it is line 755 so we cannot see the definition anymore
    image

  4. I go back to the previous file where this was used in the code
    image

  5. I do a gd again and this time it jumps to the right file but not the right line
    image

as you can see it jumps to the top of the screen line 694. if I set the cursor back to the bottom of the file and try gd again and again it keeps going to the same line. However if I leave it to line 694 and then go back to the previous file and do a gd it will jump up to line 668, if I go back and to a gd it will jump to line 642 and so on until it actually finds the right location.

the bug was not there on commit b7ca529

I'll try to spend some time tomorrow and see if I can identify the exact commit that introduced the bug

Error after doing a :PlugUpdate

Hi, today i did my usual :PlugUdpate, and after that, scrollview is returning an error when i open nvim:

Error detected while processing /home/hrq/.config/nvim/plugged/nvim-scrollview/plugin/scrollview.vim:
line  136:
E171: Missing :endif
Press ENTER or type command to continue

And this is strange cause i looked into the scrollview.vim file and there is a endif on that line..
Anyway, i wasn't able to fix it.

Snippet plug-ins will not work properly

When the scrollbar is displayed, the placeholder string becomes 1G when expanded with neosnippet.

System info

  • nvim --version: NVIM v0.5.0-dev+1133-g0869cbd55
  • Operating system/version: Manjaro Linux 20.2.1

Steps to reproduce using nvim -u min_vimrc -i NONE

  1. $ nvim -u min_vimrc -i NONE
  2. :normal! 15o
  3. :resize 10 (display scrollbar)
  4. :normal! gg
  5. :set ft=vim
  6. input func
  7. press <C-k> (execute <Plug>(neosnippet_jump_or_expand))
" min_vimrc
set encoding=utf-8

filetype plugin indent on
if has('vim_starting')
  let s:pluin_manager_dir='~/.config/nvim/.plugged/vim-plug'
  execute 'set runtimepath+=' . s:pluin_manager_dir
endif
call plug#begin('~/.config/nvim/.plugged')
Plug 'dstein64/nvim-scrollview'
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
call plug#end()

set nobackup
set nowritebackup
set noswapfile
set updatecount=0
set backspace=indent,eol,start
set number
language messages en_US.utf8

lua << EOF
vim.g.scrollview_winblend = 80
vim.g.scrollview_column = 1
vim.g.scrollview_current_only = 1
EOF

imap <C-k> <Plug>(neosnippet_jump_or_expand)
smap <C-k> <Plug>(neosnippet_jump_or_expand)
scrollview_issue.mp4

Actual behaviour

The func_name of the first placeholder is 1G.

function! 1G(<`2`>) abort
        <`0:TARGET`>
endfunction

Expected behaviour

The first placeholder should be func_name.

function! func_name(<`2`>) abort
        <`0:TARGET`>
endfunction

attempt to call field 'nvim_win_call' (a nil value) function

I've updated recently the plugin, it stopped working and shows a message:

function: builtin#18 .../.config/nvim/plugged/nvim-scrollview/lua/scrollview.lua:52: attempt to call field 'nvim_win_call' (a nil value)

My nvim version:

NVIM v0.5.0-dev+1327-gdc18c1e3e
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict
-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_
MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/runner/work/neovim/neovim/build/config -I/Users/runner/work/neovim/neovim/src -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Applic
ations/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/U
sers/runner/work/neovim/neovim/build/include
Compiled by [email protected]

Features: +acl +iconv +tui

Scrollview not working at all

Ive installed the plugin with packer.nvim, but I dont see any scrollbar in neovim and scrollviewRefresh doesnt work either . The startup doesnt work either :
vim.o.scrollview_on_startup = 1

I get this error
image

my neovim version :
image

Cannot do `:diffthis`

When this plugin is enabled, I cannot do :diffthis. Without the plugin, everything works like normal.

Reproduce:

vim -O file1 file2
:diffthis                 " on file 1
" Move to another window

Then the &diff option for the window is lost. WinLeave triggers :lua require('scrollview').refresh_bars_async(), and during the execution of this lua function &diff will be lost.

Flickering when using other plugins

I noticed that if I'm using nvim-scrollview, the moment I enable goyo mode, some flickering occurs.

The same happens when openning nnn, the file manager I use inside nvim.

Minimal init.vim:

let mapleader = ' '

call plug#begin(stdpath('data') . '/plugged')
Plug 'junegunn/goyo.vim'
Plug 'dstein64/nvim-scrollview'
call plug#end()

nnoremap <Leader>go :Goyo<CR>

Open a vim buffer and type <Space>go

ScrollViewDisable doesn't work when preceded by tabnext

When there is a scrollbar in the next tab, executing :tabnext | ScrollViewDisable does not remove the scrollbar in the next tab. It's no longer responsive to scrolling. This is because ScrollViewDisable is executed synchronously, preceded by :tabnext resulting in an autocommand that asynchronously generates scrollbars (and thus executes after :ScrollViewDisable).

<leftmouse> doesn't play nice with tabline-plugin barbar

Info

  • NVIM v0.5.0-dev+1099-g4d5dbea4f
  • scrollview tag v1.2.0
  • barbar commit 42d7112

Problem

buffer-/tab-line plugins like barbar show the opened buffers in the tabline. It is also possible to click on the tabs to switch to the respective buffer inside the focused window. When there are at least two buffers and two windows open one can switch the buffer of any window by clicking on the respective buffer-tab. However, when using barbar and scrollview together it doesn't work as expected.

If two buffers and two split-windows are opened and the window on the bottom is focused, then trying to open the other buffer inside the bottom-window by clicking on the buffer-tab doesn't change the buffer inside the focused bottom-window. Instead the buffer inside the top-window changes.

Minimal init.vim

set runtimepath+=~/.local/share/nvim/plugins/barbar.nvim
set runtimepath+=~/.local/share/nvim/plugins/nvim-scrollview
set mouse=a

Reproduce

  1. Open two files nvim foo bar
  2. Insert newlines into foo until the scrollbar appears.
  3. Split window into two windows :sp<cr>
  4. Change focus to bottom window :<c-w>j
  5. Click with <leftmouse> the bar-tab in the bufferline

It can be seen that the buffer changes from foo to bar in the unfocused top-window instead in the focused bottom-window. If this is repeated without loading scrollview inside the minimal init.vim or if the scrollview-mouse-bindings are disabled then it works as expected.

Expected

The buffer should change in the focused window instead in the top-window.

Feature request: Finer precision using box-drawing characters

It would be awesome if the precision of the top and bottom of the scrollbar can show different percentages of a filled cell instead of being either filled character or nothing. This can be done using characters such as ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ 🮆 🮅 🮄 ▀ 🮃 🮂 ▔

If I find the time I would be interested in implementing this myself, but I am pretty busy currently so I decided to make an issue for it first.

Thanks! And great plugin!

Not usable in wrap mode

I think scrolling should be calculated on visual lines rather than real lines.
With wrap enabled, the visual feedback is basically gone.

Greetings!

Failed to install it with Plug

I added to nvim.init:

Plug 'dstein64/nvim-scrollview'

When I call :PlugInstall I get:

x nvim-scrollview:
    error: pathspec 'master' did not match any file(s) known to git

Edit: neovim 0.4.4. Sorry, that's probably the reason then

install instructions incompletes

Hi,
Given your main branch name is 'main' instead of the legacy 'master', you should update your install instructions.

For example, with (my up-to-date) vim-plug, I had to do: Plug 'dstein64/nvim-scrollview', {'branch': 'main'}
Idk about other plugin managers though, but maybe there are similar updates to make.

Otherwise, very great plugin!

Mouse dragging feature broken.

Recently I upgraded everything to the latest version, but mouse dragging doesn't make it scroll anymore.

Environment: Linux, nvim v0.6.0

There is a lag to end mouse scrollbar dragging for buffers with foldmethod=syntax

Steps to reproduce

  1. Open a document under git source control.
  2. Run :Glog (requires vim-fugitive).
  3. Use cnext to navigate to a change with many lines.
  4. Open the folds with zR.
  5. Drag the scrollbar.

This results in a lag after the mouse button is released.

Additional information

  • This appears to be from mouse events accumulating. Turning off syntax highlighting avoids the issue.
  • On Ubuntu 20.04.2, the issue occurs on Konsole 19.12.3 and XTerm(353). It does not occur on GNOME Terminal, presumably from fewer mouse events being triggered.
mouse_scrollbar_dragging_lag.mp4

Scrollbar shows as modified buffer

This issue has two symptoms. One is that I can no longer close with my usual :qa command because I get this error:

E37: No write since last change
E162: No write since last change for buffer "[No Name]"

I am sure I can write my own function to close floating windows first then do a normal :qa if I really needed to. The bigger issue for me is that I have my tabline configured to show an "unsaved changes" marker in the tabs when any window in a tab is modified. This now always shows when a scrollbar is active which ruins a critical part of my workflow. Now I can no longer use my favorite :wa mapping which I really can't live without, and I never know if there is really an unsaved file or it's just the scrollbar.

I think there are buffer options to prevent it from ever showing as modified. Has this been attempted? I would be willing to submit a PR to fix this unless you have already tried and determined that it won't work.

Scrollbar on fixed column

Is it possible to configure the scrollbar to always appear on a fixed column, e.g. at 80 characters?

This should occur regardless of how wide the window is.

Multibyte (Unicode) characters under the scrollbar are hidden

Multibyte (Unicode) characters under the scrollbar are hidden or incorrectly displayed. See the screenshot.

screenshot

Example text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

河有人個所視光麼家快自議高保家格。取改有出物省不長廣綠時……接可的門對民假女毒!只空列了人目為向不兒難企步鄉下、總興天樂命洲?氣說望遊他表門美。的家人看認運的些!萬臺圖樂,活總知奇因、斯沒期動等如有出品選,轉四導果,裡國書可境單正;一物然將市增結是和賣國間自全同立:斯被身她吃爸!快功公造健……主以教低有樂刻冷長的大讓有、沒的收不飛來立男以功。有的立無灣裡存速歡否機著組開色!

並雖文魚然。輪把去能是就回股同員樂故:總說電生亞唱?自導地當和相!一收子客沒早才陸作,成局保……地夫靈商狀是究大著人道的上社十接依對見其:土樣全樣政,學那再只平中性度!其世好?發適水……我有這看色場運英司底庭上舉舞行上家。字長飛安母們英臺成這道快人法東的根因做,是格表業成一參如規的毛怎初下後木位影方,一定十全雲案形在文,相中是朋日日深名我有中一會或的緊院從體片的臺民,於屋院情改達精行,星巴有能人麼始防經五心我時父關極我底好不大自的友自教大的作王那,看語談了,童來室西子電著成官的夜那所得費出電中葉如?教來少舉?消看道南任整適才半率張不久持清,市好才領?又前朋活張牛不大動!水應標告不價世之,微達收海一、識研地流國故家位,上簡的區意足怎現面等臺已著日入。

是一許聲因味!眼越石問,了他色加國不量來離起到地消聲部無地這學來像愛消身元。不帶用愛於男分道務倒大寫何生沒上環。如小四路為、投臺人如奇前場裝在廣真立黨?留謝認我在起!知滿的:女的服真在,子相接:是的及別成新?

心清千大工學,無不界得前!在大毒日?

著很是知因年製示了當外期是年算覺禮對演陸花頭廠說聽給出金外集邊死用不!兩說治,康長類如件的策山下深告……力文說要到灣你此著吃:我已來樂是。有緊無想經面想。燈做的我基來日力來爸象。我護把華房質小北假會學早回般市般個張成面南展以格你開視於的,操百的解樣是了聲高成所參。

不經參,絕不日!態北因怕,一他神化試到時的書人現。統廣氣層們說而情?

或體能……的金是,有常我子這花一福心動形新思的自認成才早不等所自獲客唱生苦能業?是方說現毒,來支來身臺,分任只長統變近海力不全她中了。

以流天的花本加此親藝元子畫源們數使金,石單信子候而……聽道時為期天一。關得不字是孩任藝發義:方黃演……易世式手生就市害假人界起作熱眾唱?我物知班依長,議戲軍飛跑列論這容元年到加樣部識在問起,些行要就魚乎方一?土的次異總容,要冷二明除行、是業。

檢解小們要品和頭部好軍不望著消放辦實。像活資話重自放足的力的!重用北是到實都我出色過差雄是果布是見傳解且!腦品全一他此非多眼就當但如可亞又確發,常親那意場,發景歡票放長幾必難研議模線,她簡化或出工不主上!證不投食結老喜品別卻蘭巴打心所包聲作子黨院任岸所至一許後國空長起開地麼、劇中羅亞的?

程對師中見的體本經什文全人公數間又景建受很過格、是地小會具至?維拿濟蘭服不?

Scrolling can get stuck when there are long lines and scrolloff>0

When scrolling using <c-d>, on a document with long lines, with scrolloff>0, it's possible for scrolling to get stuck.

This is because it's possible for <c-d> to result in a state that doesn't observe the specified scrolloff (e.g., the cursor can be set to the top line even if that does not satisfy scrolloff). When returning from nvim-scrollview's temporary window workspace to the original window, the view is changed to satisfy scrolloff.

This is related to vim/vim#8654, where in that case winrestview results in the change of view to satisfy scrolloff, whereas changing windows is what results in the change of view to satisfy scrolloff here.

Steps to reproduce

  1. Download screencast.gif
  2. Install nvim-scrollview and load Neovim.
  3. :edit screencast.gif
  4. :set lines=40
  5. :set columns=80
  6. Hold <c-d>

Expected behavior

The document would scroll to the bottom.

Actual behavior

The document stops scrolling at line 395.

Demo

scrolling_stuck_demo.mp4

Show scrollbar is interactive?

I like how Scrollbars can be dragged with the mouse 👍
Would it be possible to change the mouse pointer on hover to show it is interactive?
Like in CSS you can do style.cursor = "pointer"; on hover and "grabbable" when dragging.
Maybe it's a personal preference thing 🤷‍♂️

Thanks for the plugin. 💯

Auto hide after certain duration

It would be nice to support an auto-hide feature where there is no activity (no scrolling) for certain amount of time passed.

This can be achieved through vim.defer_fn and libuv.timer_stop.

Here's my setup for this feature through Xuyuanp/scrollbar.nvim plugin.

For now, I can make a workaround by using :ScrollViewDisable and :ScrollViewEnable, but I don't want to fiddle around with autocmd events, hence submit an issue here.

Update the scrollbar when folding changes

Great plugin!

Can we have the scrollbar updated when foldlevel is updated (e.g. zM, zR)? For example, when zM is pressed to fold everything (or zR to unfold everything), the scroll bar currently does not get updated.

PlugUpdate failed because doc/tags conflicted

I ran PlugUpdate but failed only on nvim-scrollview. And the error messages showed the reason is git pull conflict because doc/tags changed. I guess delete doc/tags would fix this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.