local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local request = helpers.request
local eq = helpers.eq
local ok = helpers.ok
local curbufmeths = helpers.curbufmeths
local bufmeths = helpers.bufmeths
local pcall_err = helpers.pcall_err
local insert = helpers.insert
local feed = helpers.feed
local clear = helpers.clear
local command = helpers.command
local meths = helpers.meths
local assert_alive = helpers.assert_alive
local function expect(contents)
return eq(contents, helpers.curbuf_contents())
end
local function set_extmark(ns_id, id, line, col, opts)
if opts == nil then
opts = {}
end
if id ~= nil and id ~= 0 then
opts.id = id
end
return curbufmeths.set_extmark(ns_id, line, col, opts)
end
local function get_extmarks(ns_id, start, end_, opts)
if opts == nil then
opts = {}
end
return curbufmeths.get_extmarks(ns_id, start, end_, opts)
end
local function get_extmark_by_id(ns_id, id, opts)
if opts == nil then
opts = {}
end
return curbufmeths.get_extmark_by_id(ns_id, id, opts)
end
local function check_undo_redo(ns, mark, sr, sc, er, ec) --s = start, e = end
local rv = get_extmark_by_id(ns, mark)
eq({er, ec}, rv)
feed("u")
rv = get_extmark_by_id(ns, mark)
eq({sr, sc}, rv)
feed("<c-r>")
rv = get_extmark_by_id(ns, mark)
eq({er, ec}, rv)
end
local function batch_set(ns_id, positions)
local ids = {}
for _, pos in ipairs(positions) do
table.insert(ids, set_extmark(ns_id, 0, pos[1], pos[2]))
end
return ids
end
local function batch_check(ns_id, ids, positions)
local actual, expected = {}, {}
for i<
|