mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736
This commit is contained in:
@@ -577,7 +577,7 @@ describe('Buffer highlighting', function()
|
||||
end)
|
||||
|
||||
describe('virtual text decorations', function()
|
||||
local id1, id2
|
||||
local id1, id2 ---@type integer, integer
|
||||
before_each(function()
|
||||
insert([[
|
||||
1 + 2
|
||||
@@ -709,7 +709,7 @@ describe('Buffer highlighting', function()
|
||||
0,
|
||||
0,
|
||||
{
|
||||
ns_id = 1,
|
||||
ns_id = id1,
|
||||
priority = 0,
|
||||
virt_text = s1,
|
||||
-- other details
|
||||
@@ -729,7 +729,7 @@ describe('Buffer highlighting', function()
|
||||
lastline,
|
||||
0,
|
||||
{
|
||||
ns_id = 1,
|
||||
ns_id = id1,
|
||||
priority = 0,
|
||||
virt_text = s2,
|
||||
-- other details
|
||||
@@ -898,11 +898,15 @@ describe('Buffer highlighting', function()
|
||||
end)
|
||||
|
||||
it('and virtual text use the same namespace counter', function()
|
||||
eq(1, add_highlight(0, 0, 'String', 0, 0, -1))
|
||||
eq(2, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
|
||||
eq(3, api.nvim_create_namespace('my-ns'))
|
||||
eq(4, add_highlight(0, 0, 'String', 0, 0, -1))
|
||||
eq(5, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
|
||||
eq(6, api.nvim_create_namespace('other-ns'))
|
||||
local base = vim.iter(api.nvim_get_namespaces()):fold(0, function(acc, _, v)
|
||||
return math.max(acc, v)
|
||||
end)
|
||||
|
||||
eq(base + 1, add_highlight(0, 0, 'String', 0, 0, -1))
|
||||
eq(base + 2, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
|
||||
eq(base + 3, api.nvim_create_namespace('my-ns'))
|
||||
eq(base + 4, add_highlight(0, 0, 'String', 0, 0, -1))
|
||||
eq(base + 5, set_virtual_text(0, 0, 0, { { '= text', 'Comment' } }, {}))
|
||||
eq(base + 6, api.nvim_create_namespace('other-ns'))
|
||||
end)
|
||||
end)
|
||||
|
@@ -16,7 +16,7 @@ local assert_alive = n.assert_alive
|
||||
local pcall_err = t.pcall_err
|
||||
|
||||
describe('decorations providers', function()
|
||||
local screen
|
||||
local screen ---@type test.functional.ui.screen
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = Screen.new(40, 8)
|
||||
@@ -52,6 +52,7 @@ describe('decorations providers', function()
|
||||
posp = getmark(mark, false);
|
||||
restore_buffer(&save_buf); ]]
|
||||
|
||||
--- @return integer
|
||||
local function setup_provider(code)
|
||||
return exec_lua ([[
|
||||
local api = vim.api
|
||||
@@ -848,7 +849,8 @@ for _,item in ipairs(items) do
|
||||
end]]
|
||||
|
||||
describe('extmark decorations', function()
|
||||
local screen, ns
|
||||
local screen ---@type test.functional.ui.screen
|
||||
local ns ---@type integer
|
||||
before_each( function()
|
||||
clear()
|
||||
screen = Screen.new(50, 15)
|
||||
@@ -2232,7 +2234,7 @@ describe('extmark decorations', function()
|
||||
|
||||
eq({ { 1, 0, 8, { end_col = 13, end_right_gravity = false, end_row = 0,
|
||||
hl_eol = false, hl_group = "NonText", undo_restore = false,
|
||||
ns_id = 1, priority = 4096, right_gravity = true } } },
|
||||
ns_id = ns, priority = 4096, right_gravity = true } } },
|
||||
api.nvim_buf_get_extmarks(0, ns, {0,0}, {0, -1}, {details=true}))
|
||||
end)
|
||||
|
||||
@@ -2933,7 +2935,8 @@ describe('extmark decorations', function()
|
||||
end)
|
||||
|
||||
describe('decorations: inline virtual text', function()
|
||||
local screen, ns
|
||||
local screen ---@type test.functional.ui.screen
|
||||
local ns ---@type integer
|
||||
before_each( function()
|
||||
clear()
|
||||
screen = Screen.new(50, 3)
|
||||
@@ -4675,7 +4678,9 @@ describe('decorations: inline virtual text', function()
|
||||
end)
|
||||
|
||||
describe('decorations: virtual lines', function()
|
||||
local screen, ns
|
||||
local screen ---@type test.functional.ui.screen
|
||||
local ns ---@type integer
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = Screen.new(50, 12)
|
||||
@@ -5732,7 +5737,9 @@ if (h->n_buckets < new_n_buckets) { // expand
|
||||
end)
|
||||
|
||||
describe('decorations: signs', function()
|
||||
local screen, ns
|
||||
local screen ---@type test.functional.ui.screen
|
||||
local ns ---@type integer
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
screen = Screen.new(50, 10)
|
||||
@@ -6342,7 +6349,7 @@ l5
|
||||
end)
|
||||
|
||||
describe('decorations: virt_text', function()
|
||||
local screen
|
||||
local screen ---@type test.functional.ui.screen
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
@@ -6416,7 +6423,10 @@ describe('decorations: virt_text', function()
|
||||
end)
|
||||
|
||||
describe('decorations: window scoped', function()
|
||||
local screen, ns, win_other
|
||||
local screen ---@type test.functional.ui.screen
|
||||
local ns ---@type integer
|
||||
local win_other ---@type integer
|
||||
|
||||
local url = 'https://example.com'
|
||||
before_each(function()
|
||||
clear()
|
||||
|
Reference in New Issue
Block a user