mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00:00
vim-patch:8.1.0994: fix relative cursor position #9676
Problem: Relative cursor position is not calculated correctly.
Solution: Always set topline, also when window is one line only.
(Robert Webb) Add more info to getwininfo() for testing.
8fcb60f961
This commit is contained in:
@@ -4504,11 +4504,13 @@ getwininfo([{winid}]) *getwininfo()*
|
|||||||
tab pages is returned.
|
tab pages is returned.
|
||||||
|
|
||||||
Each List item is a Dictionary with the following entries:
|
Each List item is a Dictionary with the following entries:
|
||||||
|
botline last displayed buffer line
|
||||||
bufnr number of buffer in the window
|
bufnr number of buffer in the window
|
||||||
height window height (excluding winbar)
|
height window height (excluding winbar)
|
||||||
loclist 1 if showing a location list
|
loclist 1 if showing a location list
|
||||||
quickfix 1 if quickfix or location list window
|
quickfix 1 if quickfix or location list window
|
||||||
tabnr tab page number
|
tabnr tab page number
|
||||||
|
topline first displayed buffer line
|
||||||
variables a reference to the dictionary with
|
variables a reference to the dictionary with
|
||||||
window-local variables
|
window-local variables
|
||||||
width window width
|
width window width
|
||||||
|
@@ -10316,6 +10316,8 @@ static dict_T *get_win_info(win_T *wp, int16_t tpnr, int16_t winnr)
|
|||||||
tv_dict_add_nr(dict, S_LEN("winid"), wp->handle);
|
tv_dict_add_nr(dict, S_LEN("winid"), wp->handle);
|
||||||
tv_dict_add_nr(dict, S_LEN("height"), wp->w_height);
|
tv_dict_add_nr(dict, S_LEN("height"), wp->w_height);
|
||||||
tv_dict_add_nr(dict, S_LEN("winrow"), wp->w_winrow);
|
tv_dict_add_nr(dict, S_LEN("winrow"), wp->w_winrow);
|
||||||
|
tv_dict_add_nr(dict, S_LEN("topline"), wp->w_topline);
|
||||||
|
tv_dict_add_nr(dict, S_LEN("botline"), wp->w_botline - 1);
|
||||||
tv_dict_add_nr(dict, S_LEN("width"), wp->w_width);
|
tv_dict_add_nr(dict, S_LEN("width"), wp->w_width);
|
||||||
tv_dict_add_nr(dict, S_LEN("bufnr"), wp->w_buffer->b_fnum);
|
tv_dict_add_nr(dict, S_LEN("bufnr"), wp->w_buffer->b_fnum);
|
||||||
tv_dict_add_nr(dict, S_LEN("wincol"), wp->w_wincol);
|
tv_dict_add_nr(dict, S_LEN("wincol"), wp->w_wincol);
|
||||||
|
@@ -518,4 +518,132 @@ func Test_winrestcmd()
|
|||||||
only
|
only
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_relative_cursor_position_in_one_line_window()
|
||||||
|
new
|
||||||
|
only
|
||||||
|
call setline(1, range(1, 10000))
|
||||||
|
normal 50%
|
||||||
|
let lnum = getcurpos()[1]
|
||||||
|
split
|
||||||
|
split
|
||||||
|
" make third window take as many lines as possible, other windows will
|
||||||
|
" become one line
|
||||||
|
3wincmd w
|
||||||
|
for i in range(1, &lines - 6)
|
||||||
|
wincmd +
|
||||||
|
redraw!
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" first and second window should show cursor line
|
||||||
|
let wininfo = getwininfo()
|
||||||
|
call assert_equal(lnum, wininfo[0].topline)
|
||||||
|
call assert_equal(lnum, wininfo[1].topline)
|
||||||
|
|
||||||
|
only!
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_relative_cursor_position_after_move_and_resize()
|
||||||
|
let so_save = &so
|
||||||
|
set so=0
|
||||||
|
enew
|
||||||
|
call setline(1, range(1, 10000))
|
||||||
|
normal 50%
|
||||||
|
split
|
||||||
|
1wincmd w
|
||||||
|
" Move cursor to first line in window
|
||||||
|
normal H
|
||||||
|
redraw!
|
||||||
|
" Reduce window height to two lines
|
||||||
|
let height = winheight(0)
|
||||||
|
while winheight(0) > 2
|
||||||
|
wincmd -
|
||||||
|
redraw!
|
||||||
|
endwhile
|
||||||
|
" move cursor to second/last line in window
|
||||||
|
normal j
|
||||||
|
" restore previous height
|
||||||
|
while winheight(0) < height
|
||||||
|
wincmd +
|
||||||
|
redraw!
|
||||||
|
endwhile
|
||||||
|
" make window two lines again
|
||||||
|
while winheight(0) > 2
|
||||||
|
wincmd -
|
||||||
|
redraw!
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" cursor should be at bottom line
|
||||||
|
let info = getwininfo(win_getid())[0]
|
||||||
|
call assert_equal(info.topline + 1, getcurpos()[1])
|
||||||
|
|
||||||
|
only!
|
||||||
|
bwipe!
|
||||||
|
let &so = so_save
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_relative_cursor_position_after_resize()
|
||||||
|
let so_save = &so
|
||||||
|
set so=0
|
||||||
|
enew
|
||||||
|
call setline(1, range(1, 10000))
|
||||||
|
normal 50%
|
||||||
|
split
|
||||||
|
1wincmd w
|
||||||
|
let winid1 = win_getid()
|
||||||
|
let info = getwininfo(winid1)[0]
|
||||||
|
" Move cursor to second line in window
|
||||||
|
exe "normal " . (info.topline + 1) . "G"
|
||||||
|
redraw!
|
||||||
|
let lnum = getcurpos()[1]
|
||||||
|
|
||||||
|
" Make the window only two lines high, cursor should end up in top line
|
||||||
|
2wincmd w
|
||||||
|
exe (info.height - 2) . "wincmd +"
|
||||||
|
redraw!
|
||||||
|
let info = getwininfo(winid1)[0]
|
||||||
|
call assert_equal(lnum, info.topline)
|
||||||
|
|
||||||
|
only!
|
||||||
|
bwipe!
|
||||||
|
let &so = so_save
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_relative_cursor_second_line_after_resize()
|
||||||
|
let so_save = &so
|
||||||
|
set so=0
|
||||||
|
enew
|
||||||
|
call setline(1, range(1, 10000))
|
||||||
|
normal 50%
|
||||||
|
split
|
||||||
|
1wincmd w
|
||||||
|
let winid1 = win_getid()
|
||||||
|
let info = getwininfo(winid1)[0]
|
||||||
|
|
||||||
|
" Make the window only two lines high
|
||||||
|
2wincmd _
|
||||||
|
|
||||||
|
" Move cursor to second line in window
|
||||||
|
normal H
|
||||||
|
normal j
|
||||||
|
|
||||||
|
" Make window size bigger, then back to 2 lines
|
||||||
|
for i in range(1, 10)
|
||||||
|
wincmd +
|
||||||
|
redraw!
|
||||||
|
endfor
|
||||||
|
for i in range(1, 10)
|
||||||
|
wincmd -
|
||||||
|
redraw!
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" cursor should end up in bottom line
|
||||||
|
let info = getwininfo(winid1)[0]
|
||||||
|
call assert_equal(info.topline + 1, getcurpos()[1])
|
||||||
|
|
||||||
|
only!
|
||||||
|
bwipe!
|
||||||
|
let &so = so_save
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -5332,7 +5332,10 @@ void win_drag_vsep_line(win_T *dragwin, int offset)
|
|||||||
void set_fraction(win_T *wp)
|
void set_fraction(win_T *wp)
|
||||||
{
|
{
|
||||||
if (wp->w_height_inner > 1) {
|
if (wp->w_height_inner > 1) {
|
||||||
wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT + wp->w_height_inner / 2)
|
// When cursor is in the first line the percentage is computed as if
|
||||||
|
// it's halfway that line. Thus with two lines it is 25%, with three
|
||||||
|
// lines 17%, etc. Similarly for the last line: 75%, 83%, etc.
|
||||||
|
wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT + FRACTION_MULT / 2)
|
||||||
/ (long)wp->w_height_inner;
|
/ (long)wp->w_height_inner;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5364,8 +5367,8 @@ void scroll_to_fraction(win_T *wp, int prev_height)
|
|||||||
int sline, line_size;
|
int sline, line_size;
|
||||||
int height = wp->w_height_inner;
|
int height = wp->w_height_inner;
|
||||||
|
|
||||||
/* Don't change w_topline when height is zero. Don't set w_topline when
|
// Don't change w_topline when height is zero. Don't set w_topline when
|
||||||
* 'scrollbind' is set and this isn't the current window. */
|
// 'scrollbind' is set and this isn't the current window.
|
||||||
if (height > 0
|
if (height > 0
|
||||||
&& (!wp->w_p_scb || wp == curwin)
|
&& (!wp->w_p_scb || wp == curwin)
|
||||||
) {
|
) {
|
||||||
@@ -5376,8 +5379,7 @@ void scroll_to_fraction(win_T *wp, int prev_height)
|
|||||||
lnum = wp->w_cursor.lnum;
|
lnum = wp->w_cursor.lnum;
|
||||||
if (lnum < 1) /* can happen when starting up */
|
if (lnum < 1) /* can happen when starting up */
|
||||||
lnum = 1;
|
lnum = 1;
|
||||||
wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L + FRACTION_MULT / 2)
|
wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L) / FRACTION_MULT;
|
||||||
/ FRACTION_MULT;
|
|
||||||
line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
|
line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
|
||||||
sline = wp->w_wrow - line_size;
|
sline = wp->w_wrow - line_size;
|
||||||
|
|
||||||
@@ -5408,7 +5410,6 @@ void scroll_to_fraction(win_T *wp, int prev_height)
|
|||||||
wp->w_wrow--;
|
wp->w_wrow--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_topline(wp, lnum);
|
|
||||||
} else if (sline > 0) {
|
} else if (sline > 0) {
|
||||||
while (sline > 0 && lnum > 1) {
|
while (sline > 0 && lnum > 1) {
|
||||||
(void)hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL);
|
(void)hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL);
|
||||||
@@ -5437,12 +5438,12 @@ void scroll_to_fraction(win_T *wp, int prev_height)
|
|||||||
lnum++;
|
lnum++;
|
||||||
wp->w_wrow -= line_size + sline;
|
wp->w_wrow -= line_size + sline;
|
||||||
} else if (sline > 0) {
|
} else if (sline > 0) {
|
||||||
/* First line of file reached, use that as topline. */
|
// First line of file reached, use that as topline.
|
||||||
lnum = 1;
|
lnum = 1;
|
||||||
wp->w_wrow -= sline;
|
wp->w_wrow -= sline;
|
||||||
}
|
}
|
||||||
set_topline(wp, lnum);
|
|
||||||
}
|
}
|
||||||
|
set_topline(wp, lnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wp == curwin) {
|
if (wp == curwin) {
|
||||||
|
@@ -39,10 +39,11 @@ describe(':terminal', function()
|
|||||||
it('does not change size on WinEnter', function()
|
it('does not change size on WinEnter', function()
|
||||||
if helpers.pending_win32(pending) then return end
|
if helpers.pending_win32(pending) then return end
|
||||||
feed('<c-\\><c-n>')
|
feed('<c-\\><c-n>')
|
||||||
|
feed('k')
|
||||||
feed_command('2split')
|
feed_command('2split')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
tty ready |
|
^tty ready |
|
||||||
^rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
========== |
|
========== |
|
||||||
tty ready |
|
tty ready |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
@@ -57,8 +58,8 @@ describe(':terminal', function()
|
|||||||
tty ready |
|
tty ready |
|
||||||
rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
========== |
|
========== |
|
||||||
tty ready |
|
^tty ready |
|
||||||
^rows: 5, cols: 50 |
|
rows: 5, cols: 50 |
|
||||||
{2: } |
|
{2: } |
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
|
@@ -1274,17 +1274,18 @@ describe("'winhighlight' highlight", function()
|
|||||||
command('set number')
|
command('set number')
|
||||||
command('set colorcolumn=2')
|
command('set colorcolumn=2')
|
||||||
command('set cursorcolumn')
|
command('set cursorcolumn')
|
||||||
|
feed('k')
|
||||||
|
|
||||||
command('split')
|
command('split')
|
||||||
command('set winhl=LineNr:Background1,CursorColumn:Background2,'
|
command('set winhl=LineNr:Background1,CursorColumn:Background2,'
|
||||||
..'ColorColumn:ErrorMsg')
|
..'ColorColumn:ErrorMsg')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: 1 }v{15:e}ry tex{5:t} |
|
{1: 1 }v{15:e}ry tex^t |
|
||||||
{1: 2 }m{15:o}re tex^t |
|
{1: 2 }m{15:o}re tex{5:t} |
|
||||||
{0:~ }|
|
{0:~ }|
|
||||||
{3:[No Name] [+] }|
|
{3:[No Name] [+] }|
|
||||||
{9: 1 }v{17:e}ry tex{18:t} |
|
{9: 1 }v{17:e}ry text |
|
||||||
{9: 2 }m{17:o}re text |
|
{9: 2 }m{17:o}re tex{18:t} |
|
||||||
{4:[No Name] [+] }|
|
{4:[No Name] [+] }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
@@ -938,11 +938,11 @@ describe(":substitute, inccommand=split", function()
|
|||||||
feed(":%s/tw")
|
feed(":%s/tw")
|
||||||
-- 'cursorline' is NOT active during preview.
|
-- 'cursorline' is NOT active during preview.
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
Inc substitution on |
|
|
||||||
{12:tw}o lines |
|
{12:tw}o lines |
|
||||||
Inc substitution on |
|
Inc substitution on |
|
||||||
{12:tw}o lines |
|
{12:tw}o lines |
|
||||||
|
|
|
|
||||||
|
{15:~ }|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|2| {12:tw}o lines |
|
|2| {12:tw}o lines |
|
||||||
|4| {12:tw}o lines |
|
|4| {12:tw}o lines |
|
||||||
@@ -1185,6 +1185,7 @@ describe(":substitute, inccommand=split", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it("clears preview if non-previewable command is edited #5585", function()
|
it("clears preview if non-previewable command is edited #5585", function()
|
||||||
|
feed('gg')
|
||||||
-- Put a non-previewable command in history.
|
-- Put a non-previewable command in history.
|
||||||
feed_command("echo 'foo'")
|
feed_command("echo 'foo'")
|
||||||
-- Start an incomplete :substitute command.
|
-- Start an incomplete :substitute command.
|
||||||
@@ -2084,11 +2085,11 @@ describe(":substitute", function()
|
|||||||
|
|
||||||
feed(":%s/[0-9]\\n\\zs[A-Z]/OKO")
|
feed(":%s/[0-9]\\n\\zs[A-Z]/OKO")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
1 2 3 |
|
|
||||||
{12:OKO} B C |
|
{12:OKO} B C |
|
||||||
4 5 6 |
|
4 5 6 |
|
||||||
{12:OKO} Y Z |
|
{12:OKO} Y Z |
|
||||||
7 8 9 |
|
7 8 9 |
|
||||||
|
|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|1| 1 2 3 |
|
|1| 1 2 3 |
|
||||||
|2| {12:OKO} B C |
|
|2| {12:OKO} B C |
|
||||||
@@ -2204,11 +2205,11 @@ describe(":substitute", function()
|
|||||||
|
|
||||||
feed("/KKK")
|
feed("/KKK")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
x |
|
|
||||||
afa {12:KKK}adf la;lkd {12:KKK}alx |
|
afa {12:KKK}adf la;lkd {12:KKK}alx |
|
||||||
|
|
|
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
|
{15:~ }|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|3| afa {12:KKK}adf la;lkd {12:KKK}alx |
|
|3| afa {12:KKK}adf la;lkd {12:KKK}alx |
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
@@ -2256,11 +2257,11 @@ describe(":substitute", function()
|
|||||||
common_setup(screen, "split", multibyte_text)
|
common_setup(screen, "split", multibyte_text)
|
||||||
feed(":%s/£.*ѫ/X¥¥")
|
feed(":%s/£.*ѫ/X¥¥")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{12:X¥¥} |
|
|
||||||
a{12:X¥¥}¥KOL |
|
a{12:X¥¥}¥KOL |
|
||||||
£ ¥ libm |
|
£ ¥ libm |
|
||||||
£ ¥ |
|
£ ¥ |
|
||||||
|
|
|
|
||||||
|
{15:~ }|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|1| {12:X¥¥} PEPPERS |
|
|1| {12:X¥¥} PEPPERS |
|
||||||
|2| {12:X¥¥} |
|
|2| {12:X¥¥} |
|
||||||
@@ -2275,11 +2276,11 @@ describe(":substitute", function()
|
|||||||
|
|
||||||
feed("\\ra££ ¥")
|
feed("\\ra££ ¥")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{12:a££ ¥} |
|
|
||||||
a{12:X¥¥} |
|
a{12:X¥¥} |
|
||||||
{12:a££ ¥}¥KOL |
|
{12:a££ ¥}¥KOL |
|
||||||
£ ¥ libm |
|
£ ¥ libm |
|
||||||
£ ¥ |
|
£ ¥ |
|
||||||
|
|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|1| {12:X¥¥} |
|
|1| {12:X¥¥} |
|
||||||
|2|{12: a££ ¥} PEPPERS |
|
|2|{12: a££ ¥} PEPPERS |
|
||||||
@@ -2378,7 +2379,6 @@ describe(":substitute", function()
|
|||||||
|
|
||||||
feed("\\rѫ ab \\rXXXX")
|
feed("\\rѫ ab \\rXXXX")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
7 8 9 |
|
|
||||||
K L M |
|
K L M |
|
||||||
{12:JLKR £} |
|
{12:JLKR £} |
|
||||||
{12:ѫ ab } |
|
{12:ѫ ab } |
|
||||||
@@ -2387,6 +2387,7 @@ describe(":substitute", function()
|
|||||||
{12:ѫ ab } |
|
{12:ѫ ab } |
|
||||||
{12:XXXX} e f |
|
{12:XXXX} e f |
|
||||||
{12:JLKR £} |
|
{12:JLKR £} |
|
||||||
|
{12:ѫ ab } |
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
| 7| {12:JLKR £} |
|
| 7| {12:JLKR £} |
|
||||||
| 8|{12: ѫ ab } |
|
| 8|{12: ѫ ab } |
|
||||||
@@ -2480,14 +2481,15 @@ describe(":substitute", function()
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
feed("<C-c>")
|
feed("<C-c>")
|
||||||
|
feed('gg')
|
||||||
wait()
|
wait()
|
||||||
feed([[:%s/\(some\)\@<lt>!thing/one/]])
|
feed([[:%s/\(some\)\@<lt>!thing/one/]])
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
something |
|
|
||||||
every{12:one} |
|
every{12:one} |
|
||||||
someone |
|
someone |
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
|
{15:~ }|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|2| every{12:one} |
|
|2| every{12:one} |
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
@@ -2525,11 +2527,11 @@ describe(":substitute", function()
|
|||||||
wait()
|
wait()
|
||||||
feed([[:%s/some\(thing\)\@!/every/]])
|
feed([[:%s/some\(thing\)\@!/every/]])
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
everything |
|
|
||||||
{12:every}one |
|
{12:every}one |
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
|
{15:~ }|
|
||||||
{11:[No Name] [+] }|
|
{11:[No Name] [+] }|
|
||||||
|3| {12:every}one |
|
|3| {12:every}one |
|
||||||
{15:~ }|
|
{15:~ }|
|
||||||
|
@@ -649,13 +649,14 @@ describe('ui/mouse/input', function()
|
|||||||
mouse scrolling
|
mouse scrolling
|
||||||
]])
|
]])
|
||||||
screen:try_resize(53, 14)
|
screen:try_resize(53, 14)
|
||||||
|
feed('k')
|
||||||
feed_command('sp', 'vsp')
|
feed_command('sp', 'vsp')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
lines {4:│}lines |
|
lines {4:│}lines |
|
||||||
to {4:│}to |
|
to {4:│}to |
|
||||||
test {4:│}test |
|
test {4:│}test |
|
||||||
mouse scrolling {4:│}mouse scrolling |
|
^mouse scrolling {4:│}mouse scrolling |
|
||||||
^ {4:│} |
|
{4:│} |
|
||||||
{0:~ }{4:│}{0:~ }|
|
{0:~ }{4:│}{0:~ }|
|
||||||
{5:[No Name] [+] }{4:[No Name] [+] }|
|
{5:[No Name] [+] }{4:[No Name] [+] }|
|
||||||
to |
|
to |
|
||||||
@@ -672,8 +673,8 @@ describe('ui/mouse/input', function()
|
|||||||
feed('<ScrollWheelDown><0,0>')
|
feed('<ScrollWheelDown><0,0>')
|
||||||
end
|
end
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
mouse scrolling {4:│}lines |
|
^mouse scrolling {4:│}lines |
|
||||||
^ {4:│}to |
|
{4:│}to |
|
||||||
{0:~ }{4:│}test |
|
{0:~ }{4:│}test |
|
||||||
{0:~ }{4:│}mouse scrolling |
|
{0:~ }{4:│}mouse scrolling |
|
||||||
{0:~ }{4:│} |
|
{0:~ }{4:│} |
|
||||||
@@ -693,8 +694,8 @@ describe('ui/mouse/input', function()
|
|||||||
feed('<ScrollWheelUp><27,0>')
|
feed('<ScrollWheelUp><27,0>')
|
||||||
end
|
end
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
mouse scrolling {4:│}text |
|
^mouse scrolling {4:│}text |
|
||||||
^ {4:│}with |
|
{4:│}with |
|
||||||
{0:~ }{4:│}many |
|
{0:~ }{4:│}many |
|
||||||
{0:~ }{4:│}lines |
|
{0:~ }{4:│}lines |
|
||||||
{0:~ }{4:│}to |
|
{0:~ }{4:│}to |
|
||||||
@@ -715,8 +716,8 @@ describe('ui/mouse/input', function()
|
|||||||
feed('<ScrollWheelUp><27,7><ScrollWheelUp>')
|
feed('<ScrollWheelUp><27,7><ScrollWheelUp>')
|
||||||
end
|
end
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
mouse scrolling {4:│}text |
|
^mouse scrolling {4:│}text |
|
||||||
^ {4:│}with |
|
{4:│}with |
|
||||||
{0:~ }{4:│}many |
|
{0:~ }{4:│}many |
|
||||||
{0:~ }{4:│}lines |
|
{0:~ }{4:│}lines |
|
||||||
{0:~ }{4:│}to |
|
{0:~ }{4:│}to |
|
||||||
|
@@ -1198,20 +1198,20 @@ describe('builtin popupmenu', function()
|
|||||||
|
|
||||||
command("split")
|
command("split")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
xx |
|
|
||||||
choice^ |
|
choice^ |
|
||||||
|
{1:~ }|
|
||||||
{n:word }{1: }|
|
{n:word }{1: }|
|
||||||
{s:choice }{4: }|
|
{s:choice }{4: }|
|
||||||
{n:text } |
|
{n:text } |
|
||||||
{n:thing } |
|
{n:thing }{1: }|
|
||||||
{3:[No Name] [+] }|
|
{3:[No Name] [+] }|
|
||||||
{2:-- INSERT --} |
|
{2:-- INSERT --} |
|
||||||
]])
|
]])
|
||||||
|
|
||||||
meths.input_mouse('wheel', 'down', '', 0, 6, 15)
|
meths.input_mouse('wheel', 'down', '', 0, 6, 15)
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
xx |
|
|
||||||
choice^ |
|
choice^ |
|
||||||
|
{1:~ }|
|
||||||
{n:word }{1: }|
|
{n:word }{1: }|
|
||||||
{s:choice }{4: }|
|
{s:choice }{4: }|
|
||||||
{n:text } |
|
{n:text } |
|
||||||
|
@@ -356,16 +356,17 @@ describe('Screen', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('between windows', function()
|
it('between windows', function()
|
||||||
|
feed('k')
|
||||||
command("split")
|
command("split")
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
foo {1:b} bar {1:b} eggs |
|
|
||||||
foo {1:b} bar {1:b} eggs |
|
foo {1:b} bar {1:b} eggs |
|
||||||
foo barf bar barf egg^s |
|
foo barf bar barf egg^s |
|
||||||
|
foo {1:b} bar {1:b} eggs |
|
||||||
|
|
|
|
||||||
{2:[No Name] [+] }|
|
{2:[No Name] [+] }|
|
||||||
foo {1:b} bar {1:b} eggs |
|
foo {1:b} bar {1:b} eggs |
|
||||||
foo {1:b} bar {1:b} eggs |
|
foo {1:b} bar {1:b} eggs |
|
||||||
|
|
foo {1:b} bar {1:b} eggs |
|
||||||
{3:[No Name] [+] }|
|
{3:[No Name] [+] }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
@@ -379,7 +380,7 @@ describe('Screen', function()
|
|||||||
{3:[No Name] [+] }|
|
{3:[No Name] [+] }|
|
||||||
foo {1:b} bar {1:b} eggs |
|
foo {1:b} bar {1:b} eggs |
|
||||||
foo barf bar barf egg^s |
|
foo barf bar barf egg^s |
|
||||||
|
|
foo {1:b} bar {1:b} eggs |
|
||||||
{2:[No Name] [+] }|
|
{2:[No Name] [+] }|
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
Reference in New Issue
Block a user