Skip to content

Commit

Permalink
fix: use less specific gitsigns namespace
Browse files Browse the repository at this point in the history
gitsigns.nvim changed their extmark namespace for signs.
Let's hope this will keep matching if if it changes again.

Fix #127
Close #126
  • Loading branch information
luukvbaal committed Jun 5, 2024
1 parent ef3617d commit b0d8063
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For example with lazy.nvim:
-- segments = {
-- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
-- {
-- sign = { name = { "Diagnostic" }, maxwidth = 2, auto = true },
-- sign = { namespace = { "diagnostic/signs" }, maxwidth = 2, auto = true },
-- click = "v:lua.ScSa"
-- },
-- { text = { builtin.lnumfunc }, click = "v:lua.ScLa", },
Expand Down Expand Up @@ -82,17 +82,8 @@ local cfg = {
DapBreakpointRejected = builtin.toggle_breakpoint,
DapBreakpoint = builtin.toggle_breakpoint,
DapBreakpointCondition = builtin.toggle_breakpoint,
DiagnosticSignError = builtin.diagnostic_click,
DiagnosticSignHint = builtin.diagnostic_click,
DiagnosticSignInfo = builtin.diagnostic_click,
DiagnosticSignWarn = builtin.diagnostic_click,
GitSignsTopdelete = builtin.gitsigns_click,
GitSignsUntracked = builtin.gitsigns_click,
GitSignsAdd = builtin.gitsigns_click,
GitSignsChange = builtin.gitsigns_click,
GitSignsChangedelete = builtin.gitsigns_click,
GitSignsDelete = builtin.gitsigns_click,
gitsigns_extmark_signs_ = builtin.gitsigns_click,
["diagnostic/signs"] = builtin.diagnostic_click,
gitsigns = builtin.gitsigns_click,
},
}
```
Expand All @@ -110,7 +101,7 @@ Each segment can contain the following elements:
condition = { true }, -- table of booleans or functions returning a boolean
sign = { -- table of fields that configure a sign segment
-- at least one of "name", "text", and "namespace" is required
-- legacy signs are matched against the defined sign name e.g. "DiagnosticSignError"
-- legacy signs are matched against the defined sign name e.g. "DapBreakpoint"
-- extmark signs can be matched against either the namespace or the sign text itself
name = { ".*" }, -- table of lua patterns to match the legacy sign name against
text = { ".*" }, -- table of lua patterns to match the extmark sign text against
Expand Down Expand Up @@ -251,11 +242,11 @@ Below follows a list of builtin click actions.
|FoldClose/Other|Right||Delete fold|
|FoldClose/Other|Right|<kbd>clickmod</kbd>|Delete fold recursively|
|Fold*|Middle||Create fold in range(click twice)|
|/*diagnostic/signs|Left||Open diagnostic float|
|/*diagnostic/signs|Middle||Select available code action|
|GitSigns*/gitsigns_extmark_signs_|Left||Preview hunk|
|GitSigns*/gitsigns_extmark_signs_|Middle||Reset hunk|
|GitSigns*/gitsigns_extmark_signs_|Right||Stage hunk|
|diagnostic/signs|Left||Open diagnostic float|
|diagnostic/signs|Middle||Select available code action|
|gitsigns|Left||Preview hunk|
|gitsigns|Middle||Reset hunk|
|gitsigns|Right||Stage hunk|

Optional dependencies:

Expand Down
8 changes: 1 addition & 7 deletions lua/statuscol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,7 @@ function M.setup(user)
DapBreakpoint = builtin.toggle_breakpoint,
DapBreakpointCondition = builtin.toggle_breakpoint,
["diagnostic/signs"] = builtin.diagnostic_click,
gitsigns_extmark_signs_ = builtin.gitsigns_click,
GitSignsTopdelete = builtin.gitsigns_click,
GitSignsUntracked = builtin.gitsigns_click,
GitSignsAdd = builtin.gitsigns_click,
GitSignsChange = builtin.gitsigns_click,
GitSignsChangedelete = builtin.gitsigns_click,
GitSignsDelete = builtin.gitsigns_click,
gitsigns = builtin.gitsigns_click,
}
if user then cfg = vim.tbl_deep_extend("force", cfg, user) end
builtin.init(cfg)
Expand Down

0 comments on commit b0d8063

Please sign in to comment.