mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 08:44:06 +00:00
foldcolumn: allow auto:X
Similar to signcolumn, allow foldcolumn to adapt itself to the number of folds. Regression: vim supports a maximum fdc of 12, this limits it to 9.
This commit is contained in:
@@ -295,4 +295,64 @@ describe("folded lines", function()
|
||||
]])
|
||||
|
||||
end)
|
||||
|
||||
it("work with autoresize", function()
|
||||
|
||||
funcs.setline(1, 'line 1')
|
||||
funcs.setline(2, 'line 2')
|
||||
funcs.setline(3, 'line 3')
|
||||
funcs.setline(4, 'line 4')
|
||||
|
||||
feed("zfj")
|
||||
command("set foldcolumn=0")
|
||||
screen:expect{grid=[[
|
||||
{5:^+-- 2 lines: line 1·························}|
|
||||
line 3 |
|
||||
line 4 |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
-- should adapt to the current nesting of folds (e.g., 1)
|
||||
command("set foldcolumn=auto:1")
|
||||
screen:expect{grid=[[
|
||||
{7:+}{5:^+-- 2 lines: line 1························}|
|
||||
{7: }line 3 |
|
||||
{7: }line 4 |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
-- fdc should not change with a new fold as the maximum is 1
|
||||
feed("zf3j")
|
||||
|
||||
screen:expect{grid=[[
|
||||
{7:+}{5:^+-- 4 lines: line 1························}|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
|
||||
-- relax the maximum fdc thus fdc should expand to
|
||||
-- accomodate the current number of folds
|
||||
command("set foldcolumn=auto:4")
|
||||
screen:expect{grid=[[
|
||||
{7:+ }{5:^+-- 4 lines: line 1·······················}|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
|
|
||||
]]}
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user