feat: rename param

This commit is contained in:
Barrett Ruth 2026-02-02 01:07:59 -05:00
parent 851cdb0214
commit ea8a2cbaa9
5 changed files with 11 additions and 11 deletions

View file

@ -86,7 +86,7 @@ CONFIGURATION *fugitive-ts-config*
using `FugitiveTsAdd`/`FugitiveTsDelete` groups using `FugitiveTsAdd`/`FugitiveTsDelete` groups
(derived from `DiffAdd`/`DiffDelete` backgrounds). (derived from `DiffAdd`/`DiffDelete` backgrounds).
{linenr} (boolean, default: true) {gutter} (boolean, default: true)
Highlight line numbers with matching colors. Highlight line numbers with matching colors.
Only visible if line numbers are enabled. Only visible if line numbers are enabled.

View file

@ -155,7 +155,7 @@ function M.highlight_hunk(bufnr, ns, hunk, opts)
line_hl_group = line_hl, line_hl_group = line_hl,
priority = 198, priority = 198,
} }
if opts.highlights.linenr then if opts.highlights.gutter then
extmark_opts.number_hl_group = line_hl extmark_opts.number_hl_group = line_hl
end end
pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, extmark_opts) pcall(vim.api.nvim_buf_set_extmark, bufnr, ns, buf_line, 0, extmark_opts)

View file

@ -1,7 +1,7 @@
---@class fugitive-ts.Highlights ---@class fugitive-ts.Highlights
---@field treesitter boolean ---@field treesitter boolean
---@field background boolean ---@field background boolean
---@field linenr boolean ---@field gutter boolean
---@field vim boolean ---@field vim boolean
---@class fugitive-ts.Config ---@class fugitive-ts.Config
@ -37,7 +37,7 @@ local default_config = {
highlights = { highlights = {
treesitter = true, treesitter = true,
background = true, background = true,
linenr = true, gutter = true,
vim = false, vim = false,
}, },
} }
@ -172,7 +172,7 @@ function M.setup(opts)
vim.validate({ vim.validate({
['highlights.treesitter'] = { opts.highlights.treesitter, 'boolean', true }, ['highlights.treesitter'] = { opts.highlights.treesitter, 'boolean', true },
['highlights.background'] = { opts.highlights.background, 'boolean', true }, ['highlights.background'] = { opts.highlights.background, 'boolean', true },
['highlights.linenr'] = { opts.highlights.linenr, 'boolean', true }, ['highlights.gutter'] = { opts.highlights.gutter, 'boolean', true },
['highlights.vim'] = { opts.highlights.vim, 'boolean', true }, ['highlights.vim'] = { opts.highlights.vim, 'boolean', true },
}) })
end end

View file

@ -36,7 +36,7 @@ describe('highlight', function()
highlights = { highlights = {
treesitter = true, treesitter = true,
background = false, background = false,
linenr = false, gutter = false,
vim = false, vim = false,
}, },
} }
@ -394,7 +394,7 @@ describe('highlight', function()
delete_buffer(bufnr) delete_buffer(bufnr)
end) end)
it('applies number_hl_group when linenr enabled', function() it('applies number_hl_group when gutter enabled', function()
local bufnr = create_buffer({ local bufnr = create_buffer({
'@@ -1,1 +1,2 @@', '@@ -1,1 +1,2 @@',
' local x = 1', ' local x = 1',
@ -412,7 +412,7 @@ describe('highlight', function()
bufnr, bufnr,
ns, ns,
hunk, hunk,
default_opts({ highlights = { background = true, linenr = true } }) default_opts({ highlights = { background = true, gutter = true } })
) )
local extmarks = get_extmarks(bufnr) local extmarks = get_extmarks(bufnr)
@ -427,7 +427,7 @@ describe('highlight', function()
delete_buffer(bufnr) delete_buffer(bufnr)
end) end)
it('does not apply number_hl_group when linenr disabled', function() it('does not apply number_hl_group when gutter disabled', function()
local bufnr = create_buffer({ local bufnr = create_buffer({
'@@ -1,1 +1,2 @@', '@@ -1,1 +1,2 @@',
' local x = 1', ' local x = 1',
@ -445,7 +445,7 @@ describe('highlight', function()
bufnr, bufnr,
ns, ns,
hunk, hunk,
default_opts({ highlights = { background = true, linenr = false } }) default_opts({ highlights = { background = true, gutter = false } })
) )
local extmarks = get_extmarks(bufnr) local extmarks = get_extmarks(bufnr)

View file

@ -28,7 +28,7 @@ describe('fugitive-ts', function()
highlights = { highlights = {
treesitter = true, treesitter = true,
background = true, background = true,
linenr = true, gutter = true,
vim = false, vim = false,
}, },
}) })