docs: api, misc

This commit is contained in:
Justin M. Keyes
2025-06-15 01:01:55 +02:00
parent c8e54bf49d
commit cb2367a1e2
10 changed files with 40 additions and 42 deletions

View File

@ -247,7 +247,7 @@ describe('prompt buffer', function()
Close]])
end)
it('can insert mutli line text', function()
it('can insert multiline text', function()
source_script()
feed('line 1<s-cr>line 2<s-cr>line 3')
screen:expect([[
@ -275,7 +275,7 @@ describe('prompt buffer', function()
]])
end)
it('can paste multiline text', function()
it('can put (p) multiline text', function()
source_script()
fn('setreg', 'a', 'line 1\nline 2\nline 3')
feed('<esc>"ap')
@ -302,7 +302,7 @@ describe('prompt buffer', function()
]])
end)
it('undo works for current prompt', function()
it('can undo current prompt', function()
source_script()
-- text editiing alowed in current prompt
feed('tests-initial<esc>')
@ -507,19 +507,18 @@ describe('prompt buffer', function()
]])
end)
it(': mark follows current prompt', function()
it("sets the ': mark", function()
source_script()
feed('asdf')
eq({ 1, 1 }, api.nvim_buf_get_mark(0, ':'))
feed('<cr>')
eq({ 3, 1 }, api.nvim_buf_get_mark(0, ':'))
end)
-- Multiline prompt.
feed('<s-cr>line1<s-cr>line2<s-cr>line3<cr>')
eq({ 11, 1 }, api.nvim_buf_get_mark(0, ':'))
it(': mark only available in prompt buffer', function()
source_script()
feed('asdf')
eq({ 1, 1 }, api.nvim_buf_get_mark(0, ':'))
-- ': mark is only available in prompt buffer.
source('set buftype=')
eq(false, pcall(api.nvim_buf_get_mark, 0, ':'))
eq("Invalid mark name: ':'", t.pcall_err(api.nvim_buf_get_mark, 0, ':'))
end)
end)