Skip to content

Commit

Permalink
chore: autoformat with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro authored and github-actions[bot] committed Nov 27, 2023
1 parent 81f6330 commit d66eeb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/neorg/modules/core/qol/toc/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ module.public = {
}

local function get_max_virtcol()
local n_line = vim.fn.line('$')
local n_line = vim.fn.line("$")
local result = 1
for i = 1, n_line do
-- FIXME: for neovim <=0.9.*, virtcol() doesn't accept winid argument
result = math.max(result, vim.fn.virtcol({i, '$'}))
result = math.max(result, vim.fn.virtcol({ i, "$" }))
end
return result
end
Expand Down Expand Up @@ -276,8 +276,8 @@ module.on_event = function(event)
if module.config.public.fit_width then
local max_virtcol_1bex = get_max_virtcol()
local current_winwidth = vim.fn.winwidth(window)
local new_winwidth = math.min(current_winwidth, math.max(30, max_virtcol_1bex-1))
vim.cmd(("vertical resize %d"):format(new_winwidth + 1)) -- +1 for margin
local new_winwidth = math.min(current_winwidth, math.max(30, max_virtcol_1bex - 1))
vim.cmd(("vertical resize %d"):format(new_winwidth + 1)) -- +1 for margin
end

local close_buffer_callback = function()
Expand Down

0 comments on commit d66eeb2

Please sign in to comment.