mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
1037ce2e46
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
58 lines
1.7 KiB
Lua
58 lines
1.7 KiB
Lua
-- Tests for adjusting window and contents
|
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
|
local Screen = require('test.functional.ui.screen')
|
|
|
|
local poke_eventloop = helpers.poke_eventloop
|
|
local clear = helpers.clear
|
|
local insert = helpers.insert
|
|
local command = helpers.command
|
|
|
|
describe('107', function()
|
|
setup(clear)
|
|
|
|
it('is working', function()
|
|
local screen = Screen.new()
|
|
screen:attach()
|
|
|
|
insert('start:')
|
|
poke_eventloop()
|
|
command('new')
|
|
command('call setline(1, range(1,256))')
|
|
command('let r=[]')
|
|
command([[
|
|
func! GetScreenStr(row)
|
|
let str = ""
|
|
for c in range(1,3)
|
|
let str .= nr2char(screenchar(a:row, c))
|
|
endfor
|
|
return str
|
|
endfunc
|
|
]])
|
|
command([[exe ":norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"]])
|
|
command('let s3=GetScreenStr(1)')
|
|
command('wincmd p')
|
|
command('call add(r, [line("w0"), s3])')
|
|
command([[exe ":norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"]])
|
|
command('let s3=GetScreenStr(1)')
|
|
command('wincmd p')
|
|
command('call add(r, [line("w0"), s3])')
|
|
command([[exe ":norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"]])
|
|
command('let s3=GetScreenStr(1)')
|
|
command(':wincmd p')
|
|
command('call add(r, [line("w0"), s3])')
|
|
command('bwipeout!')
|
|
command('$put=r')
|
|
command('call garbagecollect(1)')
|
|
|
|
screen:expect([[
|
|
start: |
|
|
[1, '1 '] |
|
|
[50, '50 '] |
|
|
^[59, '59 '] |
|
|
~ |*9
|
|
3 more lines |
|
|
]])
|
|
end)
|
|
end)
|