aboutsummaryrefslogtreecommitdiff
path: root/lua/getline.lua
blob: c8b0fe217ee63d48d774d86878c13a255268b500 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local win = vis.win
local results = {}
local l = getline(win, 1)
results[1] = l == '1: abc'

results[2] = table_cmp(getline(win, 1, 3), {'1: abc', '2: def', '3: ghi'})
win.cursor:to(4, 0)
results[3] = getline(win, '.') == '4: jkl'
results[4] = getline(win, '$') == '9: yz_'
win.cursor:to(4, 0)
results[5] = table_cmp(getline(win, '.', 3), {'4: jkl', '5: mno', '6: pqr'})

delete(win, '%')
for i = 1, #results do
	append(win, i-1, tostring(results[i]))
end
vis:command('w getline.out')