chore(fmt): format using stylua
Also fixed something in .stylua.toml that may cause stylua to fail, by the way
This commit is contained in:
@@ -69,7 +69,13 @@ function Float:open(lines, hl, title, indent)
|
||||
self.ns = vim.api.nvim_create_namespace('OutlineHelp')
|
||||
for _, h in ipairs(hl) do
|
||||
if _G._outline_nvim_has[11] then
|
||||
vim.hl.range(self.bufnr, self.ns, h.name, { h.line, h.from + indent }, { h.line, (h.to ~= -1 and h.to + indent) or -1 })
|
||||
vim.hl.range(
|
||||
self.bufnr,
|
||||
self.ns,
|
||||
h.name,
|
||||
{ h.line, h.from + indent },
|
||||
{ h.line, (h.to ~= -1 and h.to + indent) or -1 }
|
||||
)
|
||||
else
|
||||
---@diagnostic disable-next-line:deprecated
|
||||
vim.api.nvim_buf_add_highlight(
|
||||
|
||||
@@ -10,7 +10,9 @@ local M = {
|
||||
---@param bufnr integer
|
||||
function M.clear_all_ns(bufnr)
|
||||
if vim.api.nvim_buf_is_valid(bufnr) then
|
||||
pcall(function() vim.api.nvim_buf_clear_namespace(bufnr, -1, 0, -1) end)
|
||||
pcall(function()
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, -1, 0, -1)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function M.supports_buffer(bufnr, config)
|
||||
end
|
||||
end
|
||||
end
|
||||
return ft == "markdown"
|
||||
return ft == 'markdown'
|
||||
end
|
||||
|
||||
-- Parses markdown files and returns a table of SymbolInformation[] which is
|
||||
@@ -47,8 +47,8 @@ function M.handle_markdown()
|
||||
goto nextline
|
||||
end
|
||||
|
||||
local next_value = lines[line+1]
|
||||
local is_emtpy_line = #value:gsub("^%s*(.-)%s*$", "%1") == 0
|
||||
local next_value = lines[line + 1]
|
||||
local is_emtpy_line = #value:gsub('^%s*(.-)%s*$', '%1') == 0
|
||||
|
||||
local header, title = string.match(value, '^(#+)%s+(.+)$')
|
||||
if not header and next_value and not is_emtpy_line then
|
||||
|
||||
@@ -161,10 +161,12 @@ local function legacy_rename(sidebar, client, node)
|
||||
}
|
||||
local status, err
|
||||
if _G._outline_nvim_has[11] then
|
||||
status, err = client:request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf)
|
||||
status, err =
|
||||
client:request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf)
|
||||
else
|
||||
---@diagnostic disable-next-line
|
||||
status, err = client.request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf)
|
||||
status, err =
|
||||
client.request_sync('textDocument/rename', params, request_timeout, sidebar.code.buf)
|
||||
end
|
||||
if status == nil or status.err or err or status.result == nil then
|
||||
return false
|
||||
@@ -236,7 +238,7 @@ function M.show_hover(sidebar)
|
||||
|
||||
local md_lines = l.util.convert_input_to_markdown_lines(status.result.contents)
|
||||
if _G._outline_nvim_has[10] then
|
||||
md_lines = vim.split(status.result.contents, '\n', { trimempty = true });
|
||||
md_lines = vim.split(status.result.contents, '\n', { trimempty = true })
|
||||
else
|
||||
---@diagnostic disable-next-line:deprecated
|
||||
md_lines = l.util.trim_empty_lines(md_lines)
|
||||
|
||||
@@ -344,8 +344,8 @@ function Sidebar:__refresh()
|
||||
if focused_outline or not self.view:is_open() then
|
||||
return
|
||||
end
|
||||
local ft = vim.api.nvim_get_option_value("ft", { buf = buf })
|
||||
local listed = vim.api.nvim_get_option_value("ft", { buf = buf })
|
||||
local ft = vim.api.nvim_get_option_value('ft', { buf = buf })
|
||||
local listed = vim.api.nvim_get_option_value('ft', { buf = buf })
|
||||
if ft == 'OutlineHelp' or not (listed or ft == 'help') then
|
||||
return
|
||||
end
|
||||
|
||||
@@ -40,8 +40,8 @@ function M.flash_highlight(winnr, lnum, durationMs, hl_group)
|
||||
local bufnr = vim.api.nvim_win_get_buf(winnr)
|
||||
local ns
|
||||
if _G._outline_nvim_has[11] then
|
||||
ns = vim.api.nvim_create_namespace("_outline_nvim_flash")
|
||||
vim.hl.range(bufnr, ns, hl_group, { lnum-1, 0 }, { lnum-1, -1 })
|
||||
ns = vim.api.nvim_create_namespace('_outline_nvim_flash')
|
||||
vim.hl.range(bufnr, ns, hl_group, { lnum - 1, 0 }, { lnum - 1, -1 })
|
||||
else
|
||||
---@diagnostic disable-next-line:deprecated
|
||||
ns = vim.api.nvim_buf_add_highlight(bufnr, 0, hl_group, lnum - 1, 0, -1)
|
||||
|
||||
Reference in New Issue
Block a user