Skip to content

Commit

Permalink
fix: ensure real buffer numbers get logged
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Aug 25, 2023
1 parent 08b54ba commit 33ee8ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/conform/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ end
---@param formatters conform.FormatterInfo[]
---@param callback? fun(err?: string)
M.format_async = function(bufnr, formatters, callback)
if bufnr == 0 then
bufnr = vim.api.nvim_get_current_buf()
end
local idx = 1
local changedtick = vim.b[bufnr].changedtick
local original_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
Expand Down Expand Up @@ -239,6 +242,9 @@ end
---@param formatters conform.FormatterInfo[]
---@param timeout_ms integer
M.format_sync = function(bufnr, formatters, timeout_ms)
if bufnr == 0 then
bufnr = vim.api.nvim_get_current_buf()
end
local start = uv.hrtime() / 1e6
local original_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
local input_lines = original_lines
Expand Down

0 comments on commit 33ee8ba

Please sign in to comment.