Skip to content

Commit

Permalink
fix: incorrect alignment of centered text with input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Nov 27, 2023
1 parent 666e0c7 commit c6c5c81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion installer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ local function install()
local start, end_, name, width = line:find("%[([^:]+):([0-9]+)%]")
if start then
acquire_buffer_lock(buffer, function()
vim.api.nvim_buf_set_text(buffer, i - 1, start - 1, i - 1, end_, { string.rep(" ", width) })
vim.api.nvim_buf_set_text(buffer, i - 1, start - 1, i - 1, end_, { string.rep("x", width) })

vim.cmd(tostring(i) .. "center")
local difference = (width - (end_ - start)) / 2

start = start - difference
end_ = end_ - difference
end)

local subbuffer = vim.api.nvim_create_buf(false, true)
Expand Down

0 comments on commit c6c5c81

Please sign in to comment.