aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/winbar_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/winbar_spec.lua')
-rw-r--r--test/functional/ui/winbar_spec.lua52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index 5e914952e3..858a537d3a 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -3,11 +3,11 @@ local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
local insert = helpers.insert
-local meths = helpers.meths
+local api = helpers.api
local eq = helpers.eq
local poke_eventloop = helpers.poke_eventloop
local feed = helpers.feed
-local funcs = helpers.funcs
+local fn = helpers.fn
local pcall_err = helpers.pcall_err
describe('winbar', function()
@@ -39,7 +39,7 @@ describe('winbar', function()
foreground = Screen.colors.Magenta,
},
})
- meths.nvim_set_option_value('winbar', 'Set Up The Bars', {})
+ api.nvim_set_option_value('winbar', 'Set Up The Bars', {})
end)
it('works', function()
@@ -50,8 +50,8 @@ describe('winbar', function()
|
]])
-- winbar is excluded from the heights returned by winheight() and getwininfo()
- eq(11, funcs.winheight(0))
- local win_info = funcs.getwininfo(meths.nvim_get_current_win().id)[1]
+ eq(11, fn.winheight(0))
+ local win_info = fn.getwininfo(api.nvim_get_current_win().id)[1]
eq(11, win_info.height)
eq(1, win_info.winbar)
end)
@@ -184,7 +184,7 @@ describe('winbar', function()
insert [[
just some
random text]]
- meths.nvim_set_option_value('winbar', 'Hello, I am a ruler: %l,%c', {})
+ api.nvim_set_option_value('winbar', 'Hello, I am a ruler: %l,%c', {})
screen:expect {
grid = [[
{1:Hello, I am a ruler: 2,11 }|
@@ -264,7 +264,7 @@ describe('winbar', function()
line sin(theta)
line 8]])
- meths.nvim_input_mouse('left', 'press', '', 0, 5, 1)
+ api.nvim_input_mouse('left', 'press', '', 0, 5, 1)
screen:expect([[
{1:Set Up The Bars }|
line 1 |
@@ -278,9 +278,9 @@ describe('winbar', function()
{3:~ }|*3
|
]])
- eq({ 5, 1 }, meths.nvim_win_get_cursor(0))
+ eq({ 5, 1 }, api.nvim_win_get_cursor(0))
- meths.nvim_input_mouse('left', 'drag', '', 0, 6, 2)
+ api.nvim_input_mouse('left', 'drag', '', 0, 6, 2)
screen:expect([[
{1:Set Up The Bars }|
line 1 |
@@ -294,9 +294,9 @@ describe('winbar', function()
{3:~ }|*3
{1:-- VISUAL --} |
]])
- eq({ 6, 2 }, meths.nvim_win_get_cursor(0))
+ eq({ 6, 2 }, api.nvim_win_get_cursor(0))
- meths.nvim_input_mouse('left', 'drag', '', 0, 1, 2)
+ api.nvim_input_mouse('left', 'drag', '', 0, 1, 2)
screen:expect([[
{1:Set Up The Bars }|
li^n{7:e 1} |
@@ -310,11 +310,11 @@ describe('winbar', function()
{3:~ }|*3
{1:-- VISUAL --} |
]])
- eq({ 1, 2 }, meths.nvim_win_get_cursor(0))
+ eq({ 1, 2 }, api.nvim_win_get_cursor(0))
- meths.nvim_input_mouse('left', 'drag', '', 0, 0, 2)
+ api.nvim_input_mouse('left', 'drag', '', 0, 0, 2)
screen:expect_unchanged()
- eq({ 1, 2 }, meths.nvim_win_get_cursor(0))
+ eq({ 1, 2 }, api.nvim_win_get_cursor(0))
end)
it('dragging statusline with mouse works correctly', function()
@@ -331,9 +331,9 @@ describe('winbar', function()
|
]])
- meths.nvim_input_mouse('left', 'press', '', 1, 5, 10)
+ api.nvim_input_mouse('left', 'press', '', 1, 5, 10)
poke_eventloop()
- meths.nvim_input_mouse('left', 'drag', '', 1, 6, 10)
+ api.nvim_input_mouse('left', 'drag', '', 1, 6, 10)
screen:expect([[
{1:Set Up The Bars }|
^ |
@@ -346,7 +346,7 @@ describe('winbar', function()
|
]])
- meths.nvim_input_mouse('left', 'drag', '', 1, 4, 10)
+ api.nvim_input_mouse('left', 'drag', '', 1, 4, 10)
screen:expect([[
{1:Set Up The Bars }|
^ |
@@ -359,9 +359,9 @@ describe('winbar', function()
|
]])
- meths.nvim_input_mouse('left', 'press', '', 1, 11, 10)
+ api.nvim_input_mouse('left', 'press', '', 1, 11, 10)
poke_eventloop()
- meths.nvim_input_mouse('left', 'drag', '', 1, 9, 10)
+ api.nvim_input_mouse('left', 'drag', '', 1, 9, 10)
screen:expect([[
{1:Set Up The Bars }|
^ |
@@ -373,9 +373,9 @@ describe('winbar', function()
{2:[No Name] }|
|*3
]])
- eq(3, meths.nvim_get_option_value('cmdheight', {}))
+ eq(3, api.nvim_get_option_value('cmdheight', {}))
- meths.nvim_input_mouse('left', 'drag', '', 1, 11, 10)
+ api.nvim_input_mouse('left', 'drag', '', 1, 11, 10)
screen:expect([[
{1:Set Up The Bars }|
^ |
@@ -387,7 +387,7 @@ describe('winbar', function()
{2:[No Name] }|
|
]])
- eq(1, meths.nvim_get_option_value('cmdheight', {}))
+ eq(1, api.nvim_get_option_value('cmdheight', {}))
end)
it('properly equalizes window height for window-local value', function()
@@ -412,12 +412,12 @@ describe('winbar', function()
end)
it('requires window-local value for floating windows', function()
- local win = meths.nvim_open_win(
+ local win = api.nvim_open_win(
0,
false,
{ relative = 'editor', row = 2, col = 10, height = 7, width = 30 }
)
- meths.nvim_set_option_value('winbar', 'bar', {})
+ api.nvim_set_option_value('winbar', 'bar', {})
screen:expect {
grid = [[
{1:bar }|
@@ -428,7 +428,7 @@ describe('winbar', function()
|
]],
}
- meths.nvim_set_option_value('winbar', 'floaty bar', { scope = 'local', win = win.id })
+ api.nvim_set_option_value('winbar', 'floaty bar', { scope = 'local', win = win.id })
screen:expect {
grid = [[
{1:bar }|
@@ -531,7 +531,7 @@ describe('local winbar with tabs', function()
[3] = { bold = true, foreground = Screen.colors.Blue },
[4] = { underline = true, background = Screen.colors.LightGray },
})
- meths.nvim_set_option_value('winbar', 'foo', { scope = 'local', win = 0 })
+ api.nvim_set_option_value('winbar', 'foo', { scope = 'local', win = 0 })
end)
it('works', function()