mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
fix(mouse): ensure no scrolling with "ver:0" in 'mousescroll'
This commit is contained in:
parent
356244d50b
commit
b3360f0734
@ -4147,7 +4147,7 @@ static void ins_mousescroll(int dir)
|
||||
if (dir == MSCR_DOWN || dir == MSCR_UP) {
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) {
|
||||
scroll_redraw(dir, (long)(curwin->w_botline - curwin->w_topline));
|
||||
} else {
|
||||
} else if (p_mousescroll_vert > 0) {
|
||||
scroll_redraw(dir, p_mousescroll_vert);
|
||||
}
|
||||
} else {
|
||||
|
@ -3417,7 +3417,7 @@ static void nv_mousescroll(cmdarg_T *cap)
|
||||
if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN) {
|
||||
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) {
|
||||
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
|
||||
} else {
|
||||
} else if (p_mousescroll_vert > 0) {
|
||||
cap->count1 = p_mousescroll_vert;
|
||||
cap->count0 = p_mousescroll_vert;
|
||||
nv_scroll_line(cap);
|
||||
|
@ -97,6 +97,24 @@ describe("'mousescroll'", function()
|
||||
eq(10, screencol())
|
||||
scroll('left')
|
||||
eq(10, screencol())
|
||||
|
||||
-- vertical scrolling is still disabled with non-zero 'scrolloff' value
|
||||
command('set scrolloff=1')
|
||||
|
||||
eq(10, screenrow())
|
||||
scroll('up')
|
||||
eq(10, screenrow())
|
||||
scroll('down')
|
||||
eq(10, screenrow())
|
||||
|
||||
-- also in insert mode
|
||||
feed('i')
|
||||
|
||||
eq(10, screenrow())
|
||||
scroll('up')
|
||||
eq(10, screenrow())
|
||||
scroll('down')
|
||||
eq(10, screenrow())
|
||||
end)
|
||||
|
||||
local test_vertical_scrolling = function()
|
||||
|
Loading…
Reference in New Issue
Block a user