Permalink
Browse files

Merge pull request #187 from wellle/186-fix-seekselecta

186 Fix context arguments in s:seekselecta()
  • Loading branch information...
wellle committed Oct 1, 2017
2 parents 7681a53 + 8e8bfd2 commit 0f91613787202c5e22c2378bcdb9f20ce45f6687
Showing with 151 additions and 12 deletions.
  1. +2 −2 autoload/targets.vim
  2. +17 −10 test/Makefile
  3. +14 −0 test/test.vim
  4. +2 −0 test/test3.in
  5. +2 −0 test/test3.ok
  6. +2 −0 test/test3.out
  7. +56 −0 test/testM.ok
  8. +56 −0 test/testM.out
View
@@ -900,11 +900,11 @@ function! s:seekselecta(context, count)
call setpos('.', oldpos)
let last = s:lastselecta(a:context.oldpos)
let last = s:lastselecta(a:context)
call setpos('.', oldpos)
let next = s:nextselecta(a:context.oldpos)
let next = s:nextselecta(a:context)
return s:bestSeekTarget([around, next, last], oldpos, min, max, 'seekselecta')
endfunction
View
@@ -1,11 +1,18 @@
all:
@rm -f *.out
all: | test check
clean:
@rm -f *.{out,diff}
test: clean
@vim -N -u NONE --noplugin -S test.vim
@git diff --no-index test1.ok test1.out && echo "test1 OK" || echo "test1 failed"
@git diff --no-index test2.ok test2.out && echo "test2 OK" || echo "test2 failed"
@git diff --no-index test3.ok test3.out && echo "test3 OK" || echo "test3 failed"
@git diff --no-index test4.ok test4.out && echo "test4 OK" || echo "test4 failed"
@git diff --no-index test5.ok test5.out && echo "test5 OK" || echo "test5 failed"
@git diff --no-index test6.ok test6.out && echo "test6 OK" || echo "test6 failed"
@git diff --no-index test7.ok test7.out && echo "test7 OK" || echo "test7 failed"
@git diff --no-index test8.ok test8.out && echo "test8 OK" || echo "test8 failed"
check:
@git diff --no-index test1.ok test1.out > test1.diff && rm test1.diff && echo "test1 OK" || echo "test1 failed, check test1.diff"
@git diff --no-index test2.ok test2.out > test2.diff && rm test2.diff && echo "test2 OK" || echo "test2 failed, check test2.diff"
@git diff --no-index test3.ok test3.out > test3.diff && rm test3.diff && echo "test3 OK" || echo "test3 failed, check test3.diff"
@git diff --no-index test4.ok test4.out > test4.diff && rm test4.diff && echo "test4 OK" || echo "test4 failed, check test4.diff"
@git diff --no-index test5.ok test5.out > test5.diff && rm test5.diff && echo "test5 OK" || echo "test5 failed, check test5.diff"
@git diff --no-index test6.ok test6.out > test6.diff && rm test6.diff && echo "test6 OK" || echo "test6 failed, check test6.diff"
@git diff --no-index test7.ok test7.out > test7.diff && rm test7.diff && echo "test7 OK" || echo "test7 failed, check test7.diff"
@git diff --no-index test8.ok test8.out > test8.diff && rm test8.diff && echo "test8 OK" || echo "test8 failed, check test8.diff"
@git diff --no-index testM.ok testM.out > testM.diff && rm testM.diff && echo "testM OK" || echo "testM failed, check testM.diff"
View
@@ -144,6 +144,11 @@ function s:testSeeking()
execute "normal ci'" . c . "\<Esc>"
endfor
for c in split('PQ', '\zs')
execute "normal /" . c . "\<CR>"
execute "normal cia" . c . "\<Esc>"
endfor
write! test3.out
endfunction
@@ -255,6 +260,8 @@ function s:testReselect()
write! test8.out
endfunction
redir >> testM.out
call s:testBasic()
call s:testMultiline()
call s:testSeeking()
@@ -264,4 +271,11 @@ call s:testEmpty()
call s:testQuotes()
call s:testReselect()
redir END
" remove blank messages and trailing whitespace
edit! testM.out
v/./d
%s/\s\+$
write! testM.out
quit!
View
@@ -40,3 +40,5 @@ d ' e
a ' b ' c
O " this must be the last quote test
, P ( x )
( x ) Q ,
View
@@ -36,3 +36,5 @@ c 'N' e
a 'O' c
O " this must be the last quote test
, P (P)
(Q) Q ,
View
@@ -36,3 +36,5 @@ c 'N' e
a 'O' c
O " this must be the last quote test
, P (P)
(Q) Q ,
View
@@ -0,0 +1,56 @@
"test1.in"
"test1.in" 28L, 1059C
Warning: terminal cannot highlight
"test1.out"
"test1.out" [New] 6028L, 357518C written
"test2.in"
"test2.in" 25L, 263C
/comment 1
/comment 2
/comment 3
/comment 4
/comment 5
"test2.out"
"test2.out" [New] 20L, 202C written
"test3.in"
"test3.in" 44L, 302C
/A
search hit BOTTOM, continuing at TOP
/B
/C
/D
/E
/F
/G
/H
/I
/J
/K
/L
/M
/N
/O
/P
/Q
"test3.out"
"test3.out" [New] 40L, 270C written
"test4.in"
"test4.in" 6L, 101C
"test4.out"
"test4.out" [New] 28L, 517C written
"test5.in"
"test5.in" 1L, 11C
"test5.out"
"test5.out" [New] 1L, 11C written
"test6.in"
"test6.in" 3L, 21C
"test6.out"
"test6.out" [New] 3L, 30C written
"test7.in"
"test7.in" 16L, 302C
"test7.out"
"test7.out" [New] 16L, 302C written
"test8.in"
"test8.in" 1L, 13C
"test8.out"
"test8.out" [New] 1L, 12C written
View
@@ -0,0 +1,56 @@
"test1.in"
"test1.in" 28L, 1059C
Warning: terminal cannot highlight
"test1.out"
"test1.out" [New] 6028L, 357518C written
"test2.in"
"test2.in" 25L, 263C
/comment 1
/comment 2
/comment 3
/comment 4
/comment 5
"test2.out"
"test2.out" [New] 20L, 202C written
"test3.in"
"test3.in" 44L, 302C
/A
search hit BOTTOM, continuing at TOP
/B
/C
/D
/E
/F
/G
/H
/I
/J
/K
/L
/M
/N
/O
/P
/Q
"test3.out"
"test3.out" [New] 40L, 270C written
"test4.in"
"test4.in" 6L, 101C
"test4.out"
"test4.out" [New] 28L, 517C written
"test5.in"
"test5.in" 1L, 11C
"test5.out"
"test5.out" [New] 1L, 11C written
"test6.in"
"test6.in" 3L, 21C
"test6.out"
"test6.out" [New] 3L, 30C written
"test7.in"
"test7.in" 16L, 302C
"test7.out"
"test7.out" [New] 16L, 302C written
"test8.in"
"test8.in" 1L, 13C
"test8.out"
"test8.out" [New] 1L, 12C written

0 comments on commit 0f91613

Please sign in to comment.