Neovim sign gutter, designed to be mostly VCS agnostic
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Unmagic some magic constants.

+10 -3
+3 -1
lua/vcsigns/high.lua
··· 3 3 local diff = require "vcsigns.diff" 4 4 local hunkops = require "vcsigns.hunkops" 5 5 6 + local HIGHLIGHT_PRIORITY = 3 7 + 6 8 local function _highlights_namespace() 7 9 return vim.api.nvim_create_namespace "vcsigns_highlights" 8 10 end ··· 71 73 vim.api.nvim_buf_set_extmark(bufnr, ns, line, 0, { 72 74 end_line = line + hunk.plus_count, 73 75 hl_group = "VcsignsDiffAdd", 74 - priority = 3, 76 + priority = HIGHLIGHT_PRIORITY, 75 77 end_col = 0, 76 78 hl_eol = true, 77 79 strict = false,
+3 -1
lua/vcsigns/sign.lua
··· 6 6 local band = bit.band 7 7 local bor = bit.bor 8 8 9 + local SIGN_PRIORITY = 5 10 + 9 11 local function _popcount(x) 10 12 -- Count the number of bits set in x. 11 13 local count = 0 ··· 266 268 local config = { 267 269 sign_text = sign.text, 268 270 sign_hl_group = sign.hl, 269 - priority = 5, -- Low priority, default is 10. 271 + priority = SIGN_PRIORITY, 270 272 } 271 273 if vim.g.vcsigns_highlight_number then 272 274 config.number_hl_group = sign.hl
+4 -1
lua/vcsigns/util.lua
··· 2 2 3 3 local logging = require "vclib.logging" 4 4 5 + local DEFAULT_TIMEOUT_MS = 2000 6 + local TERMINAL_WIDTH = 10000 7 + 5 8 --- Print a message to the user if verbose mode is enabled. 6 9 M.verbose = logging.verbose_logger "vcsigns" 7 10 ··· 9 12 M.verbose("Running command: " .. table.concat(cmd, " ")) 10 13 local merged_opts = vim.tbl_deep_extend( 11 14 "force", 12 - { timeout = 2000, env = { COLUMNS = 10000 } }, 15 + { timeout = DEFAULT_TIMEOUT_MS, env = { COLUMNS = TERMINAL_WIDTH } }, 13 16 opts 14 17 ) 15 18 if callback == nil then