We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vim.system({ "cowsay", "hello world" }, { text = true }, function (obj) vim.schedule(function () require("fidget").notify(obj.stdout) -- display weird vim.notify(obj.stdout) -- display fine end) end)
require("fidget").notify
Default vim.notify
vim.notify
The text was updated successfully, but these errors were encountered:
Yeah, this happens because Fidget right-aligns the lines of text it is given.
You can fix that by padding the lines of text with spaces like this:
local function pad_lines(s) local lines = vim.split(s, "\n") local w = 0 for _, line in ipairs(lines) do w = math.max(w, #line) end for l, line in ipairs(lines) do lines[l] = line .. string.rep(" ", w - #line) end return table.concat(lines, "\n") end vim.system({ "cowsay", "hello world" }, { text = true }, function (obj) vim.schedule(function () local stdout = pad_lines(obj.stdout) require("fidget").notify(stdout) -- display fixed? vim.notify(stdout) -- display fine end) end)
Sorry, something went wrong.
Yeah, this happens because Fidget right-aligns the lines of text it is given. You can fix that by padding the lines of text with spaces like this: local function pad_lines(s) local lines = vim.split(s, "\n") local w = 0 for _, line in ipairs(lines) do w = math.max(w, #line) end for l, line in ipairs(lines) do lines[l] = line .. string.rep(" ", w - #line) end return table.concat(lines, "\n") end vim.system({ "cowsay", "hello world" }, { text = true }, function (obj) vim.schedule(function () local stdout = pad_lines(obj.stdout) require("fidget").notify(stdout) -- display fixed? vim.notify(stdout) -- display fine end) end)
No branches or pull requests
require("fidget").notify
Default
vim.notify
The text was updated successfully, but these errors were encountered: