aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-03-02 13:56:27 +0100
committerGitHub <noreply@github.com>2020-03-02 13:56:27 +0100
commitd22fd58629c6aa93d808d74a7e6dee79e3246ae0 (patch)
treecda0f3a59a076bae4c1cf4f6e51328eee560cf1e /test/functional
parente35ff7371f4a61621587744a7620200380abbbe9 (diff)
parent6f261d23942feb22e5aa2881bc645bce5c5ce946 (diff)
downloadrneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.tar.gz
rneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.tar.bz2
rneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.zip
Merge pull request #11716 from teto/folds_auto_backup
[RFC] foldcolumn autowidth
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/options/num_options_spec.lua2
-rw-r--r--test/functional/ui/fold_spec.lua60
2 files changed, 61 insertions, 1 deletions
diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua
index deda5c9118..abb90b3b7c 100644
--- a/test/functional/options/num_options_spec.lua
+++ b/test/functional/options/num_options_spec.lua
@@ -72,7 +72,7 @@ describe(':set validation', function()
should_fail('updatetime', -1, 'E487')
should_fail('foldlevel', -5, 'E487')
- should_fail('foldcolumn', 13, 'E474')
+ should_fail('foldcolumn', '13', 'E474')
should_fail('conceallevel', 4, 'E474')
should_fail('numberwidth', 21, 'E474')
should_fail('numberwidth', 0, 'E487')
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index f178ed1ac7..6ec45064da 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -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)