Skip to content

Commit 621f928

Browse files
committed
.
1 parent 93c3365 commit 621f928

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/select/lua/lookback.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- selecting @function.inner should look back when it's within @function.outer.
2+
local function a()
3+
print('foo')
4+
end -- call here to test
5+
6+
local function b()
7+
print('bar')
8+
end

tests/select/lua_spec.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
local Runner = require('tests.select.common').Runner
2+
3+
local run = Runner:new(it, 'tests/select/lua', {
4+
tabstop = 2,
5+
shiftwidth = 2,
6+
softtabstop = 0,
7+
expandtab = true,
8+
})
9+
10+
describe('Look back if within @function.outer range (Lua):', function()
11+
run:compare_cmds('lookback.lua', { row = 4, col = 0, cmds = { 'dim', 'k^D' } })
12+
end)
13+
14+
describe('Look forward if outside @function.outer range (Lua):', function()
15+
run:compare_cmds('lookback.lua', { row = 4, col = 0, cmds = { 'dim', '2j^D' } })
16+
end)

0 commit comments

Comments
 (0)