aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/fold_spec.lua
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-10-01 17:21:41 +0200
committerGitHub <noreply@github.com>2020-10-01 17:21:41 +0200
commita9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f (patch)
treeb424a05246dde57febd58ec1d3ea878d2c90f0bc /test/functional/ui/fold_spec.lua
parent36a5c394a59d333bf26780d03f182e79e73d33f5 (diff)
parent8154c77bef1327aca76b83a1ec5177510f6b4b7b (diff)
downloadrneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.tar.gz
rneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.tar.bz2
rneovim-a9851bfbb1bd442fa4fbe470e1c134a1b6e9b13f.zip
Merge pull request #13014 from erw7/fix-fold
screen.c: fix buffer overflow due to folding
Diffstat (limited to 'test/functional/ui/fold_spec.lua')
-rw-r--r--test/functional/ui/fold_spec.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index fe67b9f6b0..9877f30206 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -6,6 +6,8 @@ local feed_command = helpers.feed_command
local insert = helpers.insert
local funcs = helpers.funcs
local meths = helpers.meths
+local source = helpers.source
+local assert_alive = helpers.assert_alive
describe("folded lines", function()
local screen
@@ -357,4 +359,26 @@ describe("folded lines", function()
|
]]}
end)
+
+ it('does not crash when foldtext is longer than columns #12988', function()
+ source([[
+ function! MyFoldText() abort
+ return repeat('-', &columns + 100)
+ endfunction
+ ]])
+ command('set foldtext=MyFoldText()')
+ feed("i<cr><esc>")
+ feed("vkzf")
+ screen:expect{grid=[[
+ {5:^---------------------------------------------}|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ |
+ ]]}
+ assert_alive()
+ end)
end)