bug: Error in parsing commitmsg with dirty submodule
thatlittleboy opened this issue · comments
Description
The current parser doesn't support dirty submodules. It errors out. See example below.
Steps to Reproduce
- Run the following command to generate a test file
$ cat << EOF > a.COMMIT_EDITMSG
feat(vim): some title text
This commit_editmsg comes from a real life example, in a repository containing a
dirty submodule.
#
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is ahead of 'origin/master' by 8 commits.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: ../../../.config/nvim/after/ftplugin/markdown.vim
#
# Changes not staged for commit:
# modified: ../../../.config/nvim/lua/xkcd/plugins/nvim-tree.lua
# modified: ../../../.config/setup-scripts-submodule (modified content)
# vim: ft=gitcommit:noexpandtab
EOF
The offending line is the final modified
line, above the vim modeline.
- Then
tree-sitter parse a.COMMIT_EDITMSG
to run the query or via neovim treesitter Playground, you can see the errors highlighted in red.
Expected output
No error when parsing.
Good catch, I try to fix it soon !
Fixed
Thanks. I'll check it after merging into nvim-treesitter.
Works!