Skip to content

Commit

Permalink
test: more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gh-liu committed Aug 6, 2024
1 parent 7568d08 commit fdcc496
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/fold_line/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ local function on_win(_, winid, bufnr, toprow, botrow)
if fold_end_line == cur_line then
return true
end

local cur_line_flines = cur_line_finfo.lines
if cur_line_flines > 0 and fold_end_line == cur_line_flines + cur_line_fstart - 1 then
return true
end
end
end

Expand Down
51 changes: 51 additions & 0 deletions tests/screenshots/tests-test_fold_line.lua---__test_001
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--|---------|---------|---------|---------|---------|---------|---------|---------|
01|│ ┌fold
02|│ │fold
03|│---- ├ lines: fold····························································
04|│ │fold
05|│---- ╘ lines: fold····························································
06|~
07|~
08|~
09|~
10|~
11|~
12|~
13|~
14|~
15|~
16|~
17|~
18|~
19|~
20|~
21|~
22|~
23|tests/testcases/test_001.txt 7,1 Bot
24|

--|---------|---------|---------|---------|---------|---------|---------|---------|
01|01111112111111111111111111111111111111111111111111111111111111111111111111111111
02|01111112111111111111111111111111111111111111111111111111111111111111111111111111
03|00000003000000000000000000000000000000000000000000000000000000000000000000000000
04|01111112111111111111111111111111111111111111111111111111111111111111111111111111
05|00000003000000000000000000000000000000000000000000000000000000000000000000000000
06|22222222222222222222222222222222222222222222222222222222222222222222222222222222
07|22222222222222222222222222222222222222222222222222222222222222222222222222222222
08|22222222222222222222222222222222222222222222222222222222222222222222222222222222
09|22222222222222222222222222222222222222222222222222222222222222222222222222222222
10|22222222222222222222222222222222222222222222222222222222222222222222222222222222
11|22222222222222222222222222222222222222222222222222222222222222222222222222222222
12|22222222222222222222222222222222222222222222222222222222222222222222222222222222
13|22222222222222222222222222222222222222222222222222222222222222222222222222222222
14|22222222222222222222222222222222222222222222222222222222222222222222222222222222
15|22222222222222222222222222222222222222222222222222222222222222222222222222222222
16|22222222222222222222222222222222222222222222222222222222222222222222222222222222
17|22222222222222222222222222222222222222222222222222222222222222222222222222222222
18|22222222222222222222222222222222222222222222222222222222222222222222222222222222
19|22222222222222222222222222222222222222222222222222222222222222222222222222222222
20|22222222222222222222222222222222222222222222222222222222222222222222222222222222
21|22222222222222222222222222222222222222222222222222222222222222222222222222222222
22|22222222222222222222222222222222222222222222222222222222222222222222222222222222
23|44444444444444444444444444444444444444444444444444444444444444444444444444444444
24|11111111111111111111111111111111111111111111111111111111111111111111111111111111
10 changes: 10 additions & 0 deletions tests/testcases/test_001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fold
fold
fold
fold
fold
fold
fold
fold
fold
fold
29 changes: 29 additions & 0 deletions tests/testcases/test_001.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=99
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
5,6fold
8,10fold
3,10fold
1,10fold
let &fdl = &fdl
1
normal! zo
3
normal! zo
5
normal! zc
8
normal! zc
let s:l = 7 - ((6 * winheight(0) + 18) / 36)
if s:l < 1 | let s:l = 1 | endif
keepjumps exe s:l
normal! zt
keepjumps 7
normal! 0
" vim: set ft=vim :

0 comments on commit fdcc496

Please sign in to comment.