Skip to content

Commit

Permalink
feat(labeler): allow excluding certain labels with a specific case
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 29, 2023
1 parent 2b328d1 commit 6b255d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/flash/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ local defaults = {
label = {
-- allow uppercase labels
uppercase = true,
-- add any labels with the correct case here, that you want to exclude
exclude = "",
-- add a label for the first match in the current window.
-- you can always jump to the first match with `<CR>`
current = true,
Expand Down
3 changes: 3 additions & 0 deletions lua/flash/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function M:labels()
local list = vim.fn.split(labels, "\\zs")
local ret = {} ---@type string[]
local added = {} ---@type table<string, boolean>
for _, l in ipairs(vim.fn.split(self.opts.label.exclude, "\\zs")) do
added[l] = true
end
for _, l in ipairs(list) do
if not added[l] then
added[l] = true
Expand Down

0 comments on commit 6b255d3

Please sign in to comment.