Skip to content

Commit

Permalink
Merge pull request #18 from b0o/fix-schedule
Browse files Browse the repository at this point in the history
fix: schedule setting buffer modifiable
  • Loading branch information
mobily authored Apr 14, 2024
2 parents 80709f2 + 4977021 commit 8cd0493
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/nui-components/component/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,10 @@ function Component:initial_value()
end

function Component:modify_buffer_content(modify_fn)
self:set_buffer_option("modifiable", true)
vim.schedule(function()
self:set_buffer_option("modifiable", true)
modify_fn()
vim.schedule(function()
self:set_buffer_option("modifiable", false)
end)
self:set_buffer_option("modifiable", false)
end)
end

Expand Down

0 comments on commit 8cd0493

Please sign in to comment.