1" Functions about view shared by several tests 2 3" ScreenLines(lnum, width) or 4" ScreenLines([start, end], width) 5function! ScreenLines(lnum, width) abort 6 redraw! 7 if type(a:lnum) == v:t_list 8 let start = a:lnum[0] 9 let end = a:lnum[1] 10 else 11 let start = a:lnum 12 let end = a:lnum 13 endif 14 let lines = [] 15 for l in range(start, end) 16 let lines += [join(map(range(1, a:width), 'nr2char(screenchar(l, v:val))'), '')] 17 endfor 18 return lines 19endfunction 20 21function! NewWindow(height, width) abort 22 exe a:height . 'new' 23 exe a:width . 'vsp' 24 redraw! 25endfunction 26 27function! CloseWindow() abort 28 bw! 29 redraw! 30endfunction 31