chore: format code with latest options

This commit is contained in:
kevinhwang91 2023-05-06 17:37:29 +08:00
parent 138b39f5b2
commit 45aede6f5c
19 changed files with 96 additions and 98 deletions

View file

@ -7,13 +7,10 @@ charset = utf-8
trim_trailing_whitespace = true
[*.lua]
align_call_args = only_not_exist_cross_row_expression
align_table_field_to_first_field = true
local_assign_continuation_align_to_first_expression = true
keep_one_space_between_table_and_bracket = false
align_continuous_assign_statement = false
space_around_table_field_list = false
align_call_args = false
quote_style = single
remove_empty_header_and_footer_lines_in_function = true
remove_expression_list_finish_comma= true
[*.json,*.jsonc]
indent_style = tab

View file

@ -15,8 +15,11 @@ local Debounce = {}
---@param leading? boolean
---@return UfoDebounce
function Debounce:new(fn, wait, leading)
vim.validate({fn = {fn, 'function'}, wait = {wait, 'number'},
leading = {leading, 'boolean', true}})
vim.validate({
fn = {fn, 'function'},
wait = {wait, 'number'},
leading = {leading, 'boolean', true}
})
local o = setmetatable({}, self)
o.timer = nil
o.fn = vim.schedule_wrap(fn)

View file

@ -120,8 +120,7 @@ function Preview:toggleCursor()
local floatBufnr = floatwin:getBufnr()
if self.bufnr == bufnr and self.lnum - self.foldedLnum > 0 then
self.cursorSignId = fn.sign_place(self.cursorSignId or 0, 'UfoPreview',
self.cursorSignName, floatBufnr,
{lnum = self.lnum - self.foldedLnum + 1, priority = 1})
self.cursorSignName, floatBufnr, {lnum = self.lnum - self.foldedLnum + 1, priority = 1})
elseif self.cursorSignId then
pcall(fn.sign_unplace, 'UfoPreview', {buffer = floatBufnr})
self.cursorSignId = nil
@ -290,8 +289,7 @@ function Preview:peekFoldedLinesUnderCursor(enter, nextLineIncluded)
end)
self:toggleCursor()
render.mapHighlightLimitByRange(bufnr, floatwin:getBufnr(),
{lnum - 1, 0}, {endLnum - 1, #text[endLnum - lnum + 1]},
text, self.ns)
{lnum - 1, 0}, {endLnum - 1, #text[endLnum - lnum + 1]}, text, self.ns)
render.mapMatchByLnum(winid, floatwin.winid, lnum, endLnum)
vim.wo[floatwin.winid].listchars = vim.wo[winid].listchars
return floatwin.winid

View file

@ -75,8 +75,8 @@ function NvimClient.requestFoldingRange(bufnr, kind)
error('UfoFallbackException')
end
local params = {textDocument = util.make_text_document_params(bufnr)}
return NvimClient.request(client, 'textDocument/foldingRange',
params, bufnr):thenCall(function(ranges)
return NvimClient.request(client, 'textDocument/foldingRange', params, bufnr)
:thenCall(function(ranges)
if not ranges then
return {}
end