Redraw image when file contents changes #211
Answered
by
3rd
cofeek-codes
asked this question in
Q&A
-
i am working with plantuml and other "code-to-graphic" tools. I want to create an autocmd that will redraw image every time file changes. vim.api.nvim_create_autocmd("FileType", {
pattern = "image_nvim",
callback = function()
vim.keymap.set("n", "r", function()
local image = require("image").from_file(vim.fn.expand("%"))
if image then
image:clear()
image:render()
end
print("image should reload")
end, { silent = true, buffer = true })
end,
})
|
Beta Was this translation helpful? Give feedback.
Answered by
3rd
Aug 19, 2024
Replies: 1 comment 11 replies
-
Hey, can you try this branch? feat-handle-source-image-external-changes |
Beta Was this translation helpful? Give feedback.
11 replies
Answer selected by
cofeek-codes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, can you try this branch? feat-handle-source-image-external-changes
Had some discussion in #150 about this and I think we got the right solution, but didn't merge it yet.