aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
committerJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
commit21e2e46242033c7aaa6ccfb23e256680816c063c (patch)
treef089522cfb145d6e9c8a86a01d8e454ce5501e20 /test/functional/editor
parent179d3ed87b17988f5fe00d8b99f2611a28212be7 (diff)
parent760b399f6c0c6470daa0663752bd22886997f9e6 (diff)
downloadrneovim-floattitle.tar.gz
rneovim-floattitle.tar.bz2
rneovim-floattitle.zip
Merge remote-tracking branch 'upstream/master' into floattitlefloattitle
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/K_spec.lua11
-rw-r--r--test/functional/editor/mode_insert_spec.lua8
-rw-r--r--test/functional/editor/tabpage_spec.lua42
3 files changed, 59 insertions, 2 deletions
diff --git a/test/functional/editor/K_spec.lua b/test/functional/editor/K_spec.lua
index 8ad81ac3d6..3b5580540f 100644
--- a/test/functional/editor/K_spec.lua
+++ b/test/functional/editor/K_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
-local eq, clear, eval, feed, retry =
- helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.retry
+local eq, clear, eval, feed, meths, retry =
+ helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.meths, helpers.retry
describe('K', function()
local test_file = 'K_spec_out'
@@ -58,4 +58,11 @@ describe('K', function()
helpers.neq(bufnr, eval('bufnr()'))
end)
+ it('empty string falls back to :help #19298', function()
+ meths.set_option('keywordprg', '')
+ meths.buf_set_lines(0, 0, -1, true, {'doesnotexist'})
+ feed('K')
+ eq('E149: Sorry, no help for doesnotexist', meths.get_vvar('errmsg'))
+ end)
+
end)
diff --git a/test/functional/editor/mode_insert_spec.lua b/test/functional/editor/mode_insert_spec.lua
index e3d3cdbd85..cd51a65be3 100644
--- a/test/functional/editor/mode_insert_spec.lua
+++ b/test/functional/editor/mode_insert_spec.lua
@@ -6,12 +6,20 @@ local expect = helpers.expect
local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
+local curbuf_contents = helpers.curbuf_contents
describe('insert-mode', function()
before_each(function()
clear()
end)
+ it('indents only once after "!" keys #12894', function()
+ command('let counter = []')
+ command('set indentexpr=len(add(counter,0))')
+ feed('i<C-F>x')
+ eq(' x', curbuf_contents())
+ end)
+
it('CTRL-@', function()
-- Inserts last-inserted text, leaves insert-mode.
insert('hello')
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index 849a02c28b..f8ca6986bd 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -9,6 +9,9 @@ local feed = helpers.feed
local eval = helpers.eval
local exec = helpers.exec
local funcs = helpers.funcs
+local meths = helpers.meths
+local curwin = helpers.curwin
+local assert_alive = helpers.assert_alive
describe('tabpage', function()
before_each(clear)
@@ -54,6 +57,45 @@ describe('tabpage', function()
neq(999, eval('g:win_closed'))
end)
+ it('no segfault with strange WinClosed autocommand #20290', function()
+ pcall(exec, [[
+ set nohidden
+ edit Xa
+ split Xb
+ tab split
+ new
+ autocmd WinClosed * tabprev | bwipe!
+ close
+ ]])
+ assert_alive()
+ end)
+
+ it('nvim_win_close and nvim_win_hide update tabline #20285', function()
+ eq(1, #meths.list_tabpages())
+ eq({1, 1}, funcs.win_screenpos(0))
+ local win1 = curwin().id
+
+ command('tabnew')
+ eq(2, #meths.list_tabpages())
+ eq({2, 1}, funcs.win_screenpos(0))
+ local win2 = curwin().id
+
+ meths.win_close(win1, true)
+ eq(win2, curwin().id)
+ eq(1, #meths.list_tabpages())
+ eq({1, 1}, funcs.win_screenpos(0))
+
+ command('tabnew')
+ eq(2, #meths.list_tabpages())
+ eq({2, 1}, funcs.win_screenpos(0))
+ local win3 = curwin().id
+
+ meths.win_hide(win2)
+ eq(win3, curwin().id)
+ eq(1, #meths.list_tabpages())
+ eq({1, 1}, funcs.win_screenpos(0))
+ end)
+
it('switching tabpage after setting laststatus=3 #19591', function()
local screen = Screen.new(40, 8)
screen:set_default_attr_ids({