aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-08-03 00:08:17 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-08-03 00:08:17 -0600
commit9449e1b8d273ff78eb894c588110ffa0c17d6ee3 (patch)
tree9e4470c33bd4187d9f42f0b2c4aaa995310c5be8 /test/functional/editor
parent308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (diff)
parentb8dcbcc732baf84fc48d6b272c3ade0bcb129b3b (diff)
downloadrneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.gz
rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.tar.bz2
rneovim-9449e1b8d273ff78eb894c588110ffa0c17d6ee3.zip
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/mark_spec.lua7
-rw-r--r--test/functional/editor/meta_key_spec.lua2
-rw-r--r--test/functional/editor/put_spec.lua9
-rw-r--r--test/functional/editor/tabpage_spec.lua41
4 files changed, 55 insertions, 4 deletions
diff --git a/test/functional/editor/mark_spec.lua b/test/functional/editor/mark_spec.lua
index 1eb76aa628..2440867c6e 100644
--- a/test/functional/editor/mark_spec.lua
+++ b/test/functional/editor/mark_spec.lua
@@ -157,6 +157,13 @@ describe('named marks', function()
os.remove(file1)
end)
+ it("errors when using a mark in another buffer in command range", function()
+ feed('ifoo<Esc>mA')
+ command('enew')
+ feed('ibar<Esc>')
+ eq('Vim(print):E20: Mark not set', pcall_err(command, [['Aprint]]))
+ end)
+
it("leave a context mark when moving with '", function()
command("edit " .. file1)
feed("llmamA")
diff --git a/test/functional/editor/meta_key_spec.lua b/test/functional/editor/meta_key_spec.lua
index 23964ca10f..825b20138a 100644
--- a/test/functional/editor/meta_key_spec.lua
+++ b/test/functional/editor/meta_key_spec.lua
@@ -91,7 +91,7 @@ describe('meta-keys #8226 #13042', function()
command('tnoremap <A-j> alt-j')
feed('i<M-l> xxx <A-j>')
eq('meta-l xxx alt-j', exec_lua([[return _G.input_data]]))
- -- Unmapped ALT-chord is sent to terminal as-is. #16220
+ -- Unmapped ALT-chord is sent to terminal as-is. #16202 #16220
exec_lua([[_G.input_data = '']])
command('tunmap <M-l>')
feed('<M-l>')
diff --git a/test/functional/editor/put_spec.lua b/test/functional/editor/put_spec.lua
index cc9fce8f67..5050edff5c 100644
--- a/test/functional/editor/put_spec.lua
+++ b/test/functional/editor/put_spec.lua
@@ -879,9 +879,13 @@ describe('put command', function()
ine of words 2]], curbuf_contents())
end)
- local function bell_test(actions, should_ring)
- local screen = Screen.new()
+ local screen
+ setup(function()
+ screen = Screen.new()
screen:attach()
+ end)
+
+ local function bell_test(actions, should_ring)
if should_ring then
-- check bell is not set by nvim before the action
screen:sleep(50)
@@ -899,7 +903,6 @@ describe('put command', function()
end
end
end, unchanged=(not should_ring)}
- screen:detach()
end
it('should not ring the bell with gp at end of line', function()
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index 3b2c1db350..7dd0b9f154 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -1,4 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
@@ -53,6 +54,46 @@ describe('tabpage', function()
neq(999, eval('g:win_closed'))
end)
+ it('switching tabpage after setting laststatus=3 #19591', function()
+ local screen = Screen.new(40, 8)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue},
+ [1] = {bold = true, reverse = true}, -- StatusLine
+ [2] = {reverse = true}, -- StatusLineNC, TabLineFill
+ [3] = {bold = true}, -- TabLineSel
+ [4] = {background = Screen.colors.LightGrey, underline = true}, -- TabLine
+ [5] = {bold = true, foreground = Screen.colors.Magenta},
+ })
+ screen:attach()
+
+ command('tabnew')
+ command('tabprev')
+ command('set laststatus=3')
+ command('tabnext')
+ feed('<C-G>')
+ screen:expect([[
+ {4: [No Name] }{3: [No Name] }{2: }{4:X}|
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
+ "[No Name]" --No lines in buffer-- |
+ ]])
+ command('vnew')
+ screen:expect([[
+ {4: [No Name] }{3: }{5:2}{3: [No Name] }{2: }{4:X}|
+ ^ │ |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {1:[No Name] }|
+ "[No Name]" --No lines in buffer-- |
+ ]])
+ end)
+
it(":tabmove handles modifiers and addr", function()
command('tabnew | tabnew | tabnew')
eq(4, funcs.nvim_tabpage_get_number(0))