extmark: don't crash in RO buffer.

This commit is contained in:
Björn Linse
2019-11-16 11:05:56 +01:00
parent 6222cca36a
commit ebdf90e7d7
2 changed files with 16 additions and 4 deletions

View File

@@ -1262,6 +1262,12 @@ describe('Extmarks buffer api', function()
check_undo_redo(ns, marks[1], 3, 4, 2, 6)
end)
it('in read-only buffer', function()
command("view! runtime/doc/help.txt")
eq(true, curbufmeths.get_option('ro'))
local id = set_extmark(ns, 0, 0, 2)
eq({{id, 0, 2}}, get_extmarks(ns,0, -1))
end)
end)
describe('Extmarks buffer api with many marks', function()