Skip to content

Commit

Permalink
Allow a different priority for each type.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Nov 8, 2023
1 parent 2a9590a commit b0353e3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lua/scrollview/contrib/gitsigns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
-- {config} is an optional table with the following attributes:
-- - add_highlight (string): Defaults to a value from gitsigns config
-- when available, otherwise 'DiffAdd'.
-- - add_priority (number): See ':help scrollview.register_sign_spec()'
-- for the default value when not specified.
-- - add_symbol (string): Defaults to a value from gitsigns config when
-- available, otherwise box drawing heavy vertical.
-- - change_highlight (string): Defaults to a value from gitsigns config
-- when available, otherwise 'DiffChange'.
-- - change_priority (number): See ':help scrollview.register_sign_spec()'
-- for the default value when not specified.
-- - change_symbol (string): Defaults to a value from gitsigns config
-- when available, otherwise box drawing heavy vertical.
-- - delete_highlight (string): Defaults to a value from gitsigns config
-- when available, otherwise 'DiffDelete'.
-- - delete_priority (number): See ':help scrollview.register_sign_spec()'
-- for the default value when not specified.
-- - delete_symbol (string): Defaults to a value from gitsigns config
-- when available, otherwise lower one-eigth block.
-- - enabled (boolean): Whether signs are enabled immediately. If false,
Expand Down Expand Up @@ -100,22 +106,22 @@ function M.setup(config)
local add = scrollview.register_sign_spec({
group = group,
highlight = config.add_highlight,
priority = config.add_priority
symbol = config.add_symbol,
priority = config.priority
}).name

local change = scrollview.register_sign_spec({
group = group,
highlight = config.change_highlight,
priority = config.change_priority
symbol = config.change_symbol,
priority = config.priority
}).name

local delete = scrollview.register_sign_spec({
group = group,
highlight = config.delete_highlight,
priority = config.delete_priority
symbol = config.delete_symbol,
priority = config.priority
}).name

scrollview.set_sign_group_state(group, config.enabled)
Expand Down

0 comments on commit b0353e3

Please sign in to comment.