chore: Remove use of global vars + other cleanups
This commit is contained in:
@@ -217,7 +217,7 @@ function M.get_lines(flattened_outline_items)
|
|||||||
local hl_start = #string_prefix
|
local hl_start = #string_prefix
|
||||||
local hl_end = #string_prefix + #value.icon
|
local hl_end = #string_prefix + #value.icon
|
||||||
table.insert(lines, string_prefix .. value.icon .. ' ' .. value.name)
|
table.insert(lines, string_prefix .. value.icon .. ' ' .. value.name)
|
||||||
hl_type = config.options.symbols[symbols.kinds[value.kind]].hl
|
local hl_type = config.options.symbols[symbols.kinds[value.kind]].hl
|
||||||
table.insert(hl_info, { hl_start, hl_end, hl_type })
|
table.insert(hl_info, { hl_start, hl_end, hl_type })
|
||||||
end
|
end
|
||||||
return lines, hl_info
|
return lines, hl_info
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
local vim = vim
|
local vim = vim
|
||||||
local config = require 'symbols-outline.config'
|
|
||||||
local symbol_kinds = require('symbols-outline.symbols').kinds
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.markers = {
|
M.markers = {
|
||||||
@@ -55,8 +53,6 @@ function M.setup_highlights()
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local symbols = config.options.symbols
|
|
||||||
|
|
||||||
-- markers
|
-- markers
|
||||||
highlight_text('marker_middle', M.markers.middle, 'SymbolsOutlineConnector')
|
highlight_text('marker_middle', M.markers.middle, 'SymbolsOutlineConnector')
|
||||||
highlight_text(
|
highlight_text(
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ end
|
|||||||
|
|
||||||
function M.add_highlights(bufnr, hl_info)
|
function M.add_highlights(bufnr, hl_info)
|
||||||
for line, line_hl in ipairs(hl_info) do
|
for line, line_hl in ipairs(hl_info) do
|
||||||
hl_start, hl_end, hl_type = unpack(line_hl)
|
local hl_start, hl_end, hl_type = unpack(line_hl)
|
||||||
vim.api.nvim_buf_add_highlight(
|
vim.api.nvim_buf_add_highlight(
|
||||||
bufnr,
|
bufnr,
|
||||||
hlns,
|
hlns,
|
||||||
|
|||||||
Reference in New Issue
Block a user