From ebdf90e7d7c97b4355f42e06769e9424c279d695 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 16 Nov 2019 11:05:56 +0100 Subject: extmark: don't crash in RO buffer. --- test/functional/api/mark_extended_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/functional/api/mark_extended_spec.lua') diff --git a/test/functional/api/mark_extended_spec.lua b/test/functional/api/mark_extended_spec.lua index a5d68c6b9f..76db9f9d81 100644 --- a/test/functional/api/mark_extended_spec.lua +++ b/test/functional/api/mark_extended_spec.lua @@ -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() -- cgit