mirror of
https://github.com/neovim/neovim.git
synced 2026-04-19 22:10:45 +00:00
chore: format runtime with stylua
This commit is contained in:
@@ -14,14 +14,14 @@ function M.create(higroup, hi_info, default)
|
||||
local options = {}
|
||||
-- TODO: Add validation
|
||||
for k, v in pairs(hi_info) do
|
||||
table.insert(options, string.format("%s=%s", k, v))
|
||||
table.insert(options, string.format('%s=%s', k, v))
|
||||
end
|
||||
vim.cmd(string.format([[highlight %s %s %s]], default and "default" or "", higroup, table.concat(options, " ")))
|
||||
vim.cmd(string.format([[highlight %s %s %s]], default and 'default' or '', higroup, table.concat(options, ' ')))
|
||||
end
|
||||
|
||||
---@private
|
||||
function M.link(higroup, link_to, force)
|
||||
vim.cmd(string.format([[highlight%s link %s %s]], force and "!" or " default", higroup, link_to))
|
||||
vim.cmd(string.format([[highlight%s link %s %s]], force and '!' or ' default', higroup, link_to))
|
||||
end
|
||||
|
||||
--- Highlight range between two positions
|
||||
@@ -37,7 +37,7 @@ end
|
||||
-- - priority number indicating priority of highlight (default priorities.user)
|
||||
function M.range(bufnr, ns, higroup, start, finish, opts)
|
||||
opts = opts or {}
|
||||
local regtype = opts.regtype or "v"
|
||||
local regtype = opts.regtype or 'v'
|
||||
local inclusive = opts.inclusive or false
|
||||
local priority = opts.priority or M.priorities.user
|
||||
|
||||
@@ -63,7 +63,7 @@ function M.range(bufnr, ns, higroup, start, finish, opts)
|
||||
end
|
||||
end
|
||||
|
||||
local yank_ns = api.nvim_create_namespace("hlyank")
|
||||
local yank_ns = api.nvim_create_namespace('hlyank')
|
||||
--- Highlight the yanked region
|
||||
---
|
||||
--- use from init.vim via
|
||||
@@ -87,10 +87,10 @@ function M.on_yank(opts)
|
||||
if t == nil then
|
||||
return true
|
||||
else
|
||||
return type(t) == "table"
|
||||
return type(t) == 'table'
|
||||
end
|
||||
end,
|
||||
"a table or nil to configure options (see `:h highlight.on_yank`)",
|
||||
'a table or nil to configure options (see `:h highlight.on_yank`)',
|
||||
},
|
||||
})
|
||||
opts = opts or {}
|
||||
@@ -98,17 +98,17 @@ function M.on_yank(opts)
|
||||
local on_macro = opts.on_macro or false
|
||||
local on_visual = (opts.on_visual ~= false)
|
||||
|
||||
if not on_macro and vim.fn.reg_executing() ~= "" then
|
||||
if not on_macro and vim.fn.reg_executing() ~= '' then
|
||||
return
|
||||
end
|
||||
if event.operator ~= "y" or event.regtype == "" then
|
||||
if event.operator ~= 'y' or event.regtype == '' then
|
||||
return
|
||||
end
|
||||
if not on_visual and event.visual then
|
||||
return
|
||||
end
|
||||
|
||||
local higroup = opts.higroup or "IncSearch"
|
||||
local higroup = opts.higroup or 'IncSearch'
|
||||
local timeout = opts.timeout or 150
|
||||
|
||||
local bufnr = api.nvim_get_current_buf()
|
||||
|
||||
Reference in New Issue
Block a user