From d7431db55cd076dbacfde2cebaed315509923df5 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 27 Mar 2023 01:27:38 -0500 Subject: [PATCH] Update tree-sitter-git-commit, add comment textobject (#6439) The update includes a fix for comments in commit messages where there was no space separating the '#' and the comment text. The comment textobject can be useful occasionally to jump to the summary part of the commit edit message. --- book/src/generated/lang-support.md | 2 +- languages.toml | 2 +- runtime/queries/git-commit/textobjects.scm | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/git-commit/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 5cd0c8c1f..003ed4a4a 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -41,7 +41,7 @@ | fortran | ✓ | | ✓ | `fortls` | | gdscript | ✓ | ✓ | ✓ | | | git-attributes | ✓ | | | | -| git-commit | ✓ | | | | +| git-commit | ✓ | ✓ | | | | git-config | ✓ | | | | | git-ignore | ✓ | | | | | git-rebase | ✓ | | | | diff --git a/languages.toml b/languages.toml index ae4135f00..7c6c278e6 100644 --- a/languages.toml +++ b/languages.toml @@ -1194,7 +1194,7 @@ text-width = 72 [[grammar]] name = "git-commit" -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "318dd72abfaa7b8044c1d1fbeabcd06deaaf038f" } +source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "7421fd81840950c0ff4191733cee3b6ac06cb295" } [[language]] name = "diff" diff --git a/runtime/queries/git-commit/textobjects.scm b/runtime/queries/git-commit/textobjects.scm new file mode 100644 index 000000000..4465c8768 --- /dev/null +++ b/runtime/queries/git-commit/textobjects.scm @@ -0,0 +1,2 @@ +(comment) @comment.inside +(comment)+ @comment.around