aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/fold_spec.lua
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-20 15:20:42 -0500
committerGitHub <noreply@github.com>2020-12-20 15:20:42 -0500
commitb1711e6f922598f00c4d2c879094afdbba44c187 (patch)
treeda82e73ae568899dcd9c5ca1eb74ce09671e9fef /test/functional/ui/fold_spec.lua
parentabcbc5a9f346f98591f27eb73bc1c63787779368 (diff)
downloadrneovim-b1711e6f922598f00c4d2c879094afdbba44c187.tar.gz
rneovim-b1711e6f922598f00c4d2c879094afdbba44c187.tar.bz2
rneovim-b1711e6f922598f00c4d2c879094afdbba44c187.zip
foldcolumn: support "auto" (#13571)
"set foldcolumn=auto" is documented but not supported. Support it by making it behave as "auto:1", similar to "signcolumn". Close https://github.com/neovim/neovim/pull/13561
Diffstat (limited to 'test/functional/ui/fold_spec.lua')
-rw-r--r--test/functional/ui/fold_spec.lua70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 7b05e90459..6ce8b33a63 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -886,6 +886,41 @@ describe("folded lines", function()
|
]])
end
+ command("set foldcolumn=auto")
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [3:---------------------------------------------]|
+ ## grid 2
+ {7:+}{5:^+-- 2 lines: line 1························}|
+ {7: }line 3 |
+ {7: }line 4 |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ## grid 3
+ |
+ ]], unchanged=true}
+ else
+ screen:expect{grid=[[
+ {7:+}{5:^+-- 2 lines: line 1························}|
+ {7: }line 3 |
+ {7: }line 4 |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], unchanged=true}
+ end
-- fdc should not change with a new fold as the maximum is 1
feed("zf3j")
@@ -924,6 +959,41 @@ describe("folded lines", function()
]])
end
+ command("set foldcolumn=auto:1")
+ if multigrid then screen:expect{grid=[[
+ ## grid 1
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [2:---------------------------------------------]|
+ [3:---------------------------------------------]|
+ ## grid 2
+ {7:+}{5:^+-- 4 lines: line 1························}|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ## grid 3
+ |
+ ]], unchanged=true}
+ else
+ screen:expect{grid=[[
+ {7:+}{5:^+-- 4 lines: line 1························}|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]], unchanged=true}
+ end
+
-- relax the maximum fdc thus fdc should expand to
-- accomodate the current number of folds
command("set foldcolumn=auto:4")