aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/cmdline_spec.lua32
-rw-r--r--test/functional/ui/fold_spec.lua24
-rw-r--r--test/functional/ui/inccommand_spec.lua20
3 files changed, 76 insertions, 0 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 21c01b3458..01f0d8a4d7 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen')
local clear, feed = helpers.clear, helpers.feed
local source = helpers.source
local command = helpers.command
+local feed_command = helpers.feed_command
local function new_screen(opt)
local screen = Screen.new(25, 5)
@@ -842,3 +843,34 @@ describe('cmdline redraw', function()
]], unchanged=true}
end)
end)
+
+describe('cmdline', function()
+ before_each(function()
+ clear()
+ end)
+
+ it('prints every executed Ex command if verbose >= 16', function()
+ local screen = Screen.new(50, 12)
+ screen:attach()
+ source([[
+ command DoSomething echo 'hello' |set ts=4 |let v = '123' |echo v
+ call feedkeys("\r", 't') " for the hit-enter prompt
+ set verbose=20
+ ]])
+ feed_command('DoSomething')
+ screen:expect([[
+ |
+ ~ |
+ |
+ Executing: DoSomething |
+ Executing: echo 'hello' |set ts=4 |let v = '123' ||
+ echo v |
+ hello |
+ Executing: set ts=4 |let v = '123' |echo v |
+ Executing: let v = '123' |echo v |
+ Executing: echo v |
+ 123 |
+ Press ENTER or type command to continue^ |
+ ]])
+ end)
+end)
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)
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index 74e85212c8..16c5477ee4 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -2750,6 +2750,26 @@ it(':substitute with inccommand, timer-induced :redraw #9777', function()
]])
end)
+it(":substitute doesn't crash with inccommand, if undo is empty #12932", function()
+ local screen = Screen.new(10,5)
+ clear()
+ command('set undolevels=-1')
+ common_setup(screen, 'split', 'test')
+ feed(':%s/test')
+ sleep(100)
+ feed('/')
+ sleep(100)
+ feed('f')
+ screen:expect([[
+ {12:f} |
+ {15:~ }|
+ {15:~ }|
+ {15:~ }|
+ :%s/test/f^ |
+ ]])
+ assert_alive()
+end)
+
it('long :%s/ with inccommand does not collapse cmdline', function()
local screen = Screen.new(10,5)
clear()