Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lua/chafa/health.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
local M = {}

M.check = function()
vim.health.report_start("chafa.nvim health check")
vim.health.start("chafa.nvim health check")
if vim.fn.executable("chafa") == 1 then
vim.health.report_ok("no issues found")
vim.health.ok("no issues found")
else
vim.health.report_error("chafa executable not found")
vim.health.report_info("Follow installations instructions at https://hpjansson.org/chafa/download/")
vim.health.error("chafa executable not found")
vim.health.info("Follow installations instructions at https://hpjansson.org/chafa/download/")
end
end

Expand Down
3 changes: 1 addition & 2 deletions lua/chafa/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ local global_opts = nil

---@diagnostic disable-next-line: unused-local
local get_image_data_sync = function(buf_path, width, height, opts, callback)
local command = { "chafa", buf_path, "--size", width .. "x" .. height }
local command = { "chafa", buf_path, "--size", width .. "x" .. height, "--format", "symbols", "--polite", "on" }

vim.fn.jobstart(command, {
stdout_buffered = true,
on_stdout = function(_, data)
if data then
table.remove(data)
callback(data)
end
end,
Expand Down