Problem: 'scrollbind' doesn't work when scrolling inactive window.
Solution: Call do_check_scrollbind() after scrolling inactive window.
https://github.com/vim/vim/pull/13189
(3 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merging #13189 (671412f) into master (f109bf9) will increase coverage by
4.45%.
The diff coverage is100.00%.
@@ Coverage Diff @@ ## master #13189 +/- ## ========================================== + Coverage 78.30% 82.75% +4.45% ========================================== Files 150 150 Lines 152791 182132 +29341 Branches 39409 40932 +1523 ========================================== + Hits 119644 150726 +31082 + Misses 20901 18470 -2431 - Partials 12246 12936 +690
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-Array | 82.75% <100.00%> (?) |
|
| linux | 82.75% <100.00%> (?) |
|
| mingw-x64-HUGE | ? |
|
| mingw-x86-HUGE | ? |
|
| windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files | Coverage Δ | |
|---|---|---|
| src/mouse.c | 80.32% <100.00%> (+22.48%) |
⬆️ |
| src/move.c | 91.41% <ø> (+8.81%) |
⬆️ |
... and 157 files with indirect coverage changes
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I thought it was supposed to work that way. It is handy to be able to scroll the two windows independently by just clicking and moving the mouse.
I actually was using that feature today. I'd never know explicitly about it, and was surprised, but it was very handy.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Oh right, I just noticed this:
*scrollbind-quickadj*
The 'scrollbind' flag is meaningful when using keyboard commands to vertically
scroll a window, and also meaningful when using the vertical scrollbar of the
window which has the cursor focus. However, when using the vertical scrollbar
of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
This allows quick adjustment of the relative offset of 'scrollbind' windows.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Closed #13189.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
looks generally it worked in vimdiff mode which natively enabled this option for it.
// BTW: somehow sometime i faced that maybe one window off (not scrolling with another),
// i cannot and didnot dig to repro solidly, but if someone faced same situation, may look into further.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
Actually this seems achievable using WinScrolled autocommand and :windo. An autocommand for diff mode:
func ScrollBind() let oldwin = win_getid() for [win, delta] in items(v:event) let id = str2nr(win) if id == 0 continue endif if delta.topline == 0 && delta.topfill == 0 continue endif let nr = win_id2win(id) if getwinvar(nr, '&scrollbind') && getwinvar(nr, '&diff') exe nr .. 'windo :' break endif endfor call win_gotoid(oldwin) endfunc autocmd WinScrolled * call ScrollBind()
It's mainly useful in diff mode, where diff_set_topline() is used for 'scrollbind'.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
i was saying this 'scrollbind' was mainly used and default enabled in vimdiff,
but sometime it didnot sync scrolling in between (those windows),
i cannot solidly repro what happened, so deleted comment.
but the problem seems was the status of fold, if it was open/close, and there one there or not, and related lines range....
so it should be not just about delta.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()
IIUC, this is intentional (and documented):
*'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
'scrollbind' 'scb' boolean (default off)
local to window
See also |scroll-binding|. When this option is set, scrolling the
current window also scrolls other scrollbind windows (windows that
also have this option set). This option is useful for viewing the
differences between two versions of a file, see 'diff'.
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you commented.![]()