Skip to content

Commit

Permalink
fix(highlights): use updated Treesitter capture groups (post 0.9.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jan 21, 2024
1 parent 4bc9965 commit a149543
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion after/ftplugin/gitrebase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vim.fn.matchadd("tinygit_rebase_issueNumber", [[#\d\+]])
vim.api.nvim_set_hl(ns, "tinygit_rebase_issueNumber", { link = "Number" })

vim.fn.matchadd("tinygit_rebase_mdInlineCode", [[`.\{-}`]]) -- .\{-} = non-greedy quantifier
vim.api.nvim_set_hl(ns, "tinygit_rebase_mdInlineCode", { link = "@text.literal" })
vim.api.nvim_set_hl(ns, "tinygit_rebase_mdInlineCode", { link = "@markup.raw.markdown_inline" })

vim.fn.matchadd(
"tinygit_rebase_conventionalCommit",
Expand Down
4 changes: 2 additions & 2 deletions lua/tinygit/commands/commit-and-amend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ local function setupInputField(commitType)
vim.api.nvim_set_hl(ns, "issueNumber", { link = "Number" })

fn.matchadd("mdInlineCode", [[`.\{-}`]]) -- .\{-} = non-greedy quantifier
vim.api.nvim_set_hl(ns, "mdInlineCode", { link = "@text.literal" })
vim.api.nvim_set_hl(ns, "mdInlineCode", { link = "@markup.raw.markdown_inline" })

fn.matchadd("overLength", ([[.\{%s}\zs.*\ze]]):format(config.maxLen - 1))
vim.api.nvim_set_hl(ns, "overLength", { link = "ErrorMsg" })
Expand All @@ -106,7 +106,7 @@ local function setupInputField(commitType)

-- treesitter highlighting
vim.bo.filetype = "gitcommit"
vim.api.nvim_set_hl(ns, "@text.title.gitcommit", { link = "Normal" })
vim.api.nvim_set_hl(ns, "@markup.heading.gitcommit", { link = "Normal" })
-- prevent auto-wrapping due to filetype "gitcommit" being set
vim.opt_local.formatoptions:remove("t")

Expand Down

0 comments on commit a149543

Please sign in to comment.