Skip to content

Commit 7e00951

Browse files
committed
fix: schedule setting buffer modifiable
fixes #17
1 parent 0af84e5 commit 7e00951

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/nui-components/component/init.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,13 @@ function Component:initial_value()
395395
end
396396

397397
function Component:modify_buffer_content(modify_fn)
398-
self:set_buffer_option("modifiable", true)
399398
vim.schedule(function()
400-
modify_fn()
399+
self:set_buffer_option("modifiable", true)
401400
vim.schedule(function()
402-
self:set_buffer_option("modifiable", false)
401+
modify_fn()
402+
vim.schedule(function()
403+
self:set_buffer_option("modifiable", false)
404+
end)
403405
end)
404406
end)
405407
end

0 commit comments

Comments
 (0)