diff --git a/lua/fold_line/init.lua b/lua/fold_line/init.lua index fc7d4b2..b873a64 100644 --- a/lua/fold_line/init.lua +++ b/lua/fold_line/init.lua @@ -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 diff --git a/tests/screenshots/tests-test_fold_line.lua---__test_001 b/tests/screenshots/tests-test_fold_line.lua---__test_001 new file mode 100644 index 0000000..50a86ab --- /dev/null +++ b/tests/screenshots/tests-test_fold_line.lua---__test_001 @@ -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 diff --git a/tests/testcases/test_001.txt b/tests/testcases/test_001.txt new file mode 100644 index 0000000..9693ca9 --- /dev/null +++ b/tests/testcases/test_001.txt @@ -0,0 +1,10 @@ +fold +fold + fold + fold + fold + fold + fold + fold + fold + fold diff --git a/tests/testcases/test_001.vim b/tests/testcases/test_001.vim new file mode 100644 index 0000000..3636b06 --- /dev/null +++ b/tests/testcases/test_001.vim @@ -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 :