Closed dundargoc closed 1 year ago
screenshot shows this better:
why is i
in gitsigns
being concealed? why is ng
in matching
a @string.special
? No idea.
@clason are you seeing that on your system? When I use :InspectTree
on the provided text the parse tree looks perfect (NVIM v0.9.0-dev-1163+g4385f8a7430f
):
(block) ; [1:1 - 5]
(line) ; [1:1 - 1]
(word) ; [1:1 - 6:0]
(word) ; [1:7 - 16:0]
(word) ; [1:16 - 17:0]
(tag) ; [1:21 - 38:0]
text: (word) ; [1:22 - 37:0]
(line) ; [2:1 - 1:2]
(taglink) ; [2:1 - 16:1]
text: (word) ; [2:2 - 15:1]
(word) ; [2:25 - 28:1]
(word) ; [2:29 - 35:1]
(word) ; [2:36 - 37:1]
(word) ; [2:37 - 38:1]
(word) ; [2:39 - 44:1]
(word) ; [2:53 - 57:1]
(word) ; [2:58 - 65:1]
(word) ; [2:66 - 70:1]
(word) ; [2:71 - 76:1]
(word) ; [2:77 - 79:1]
(line) ; [3:1 - 1:3]
(taglink) ; [3:1 - 18:2]
text: (word) ; [3:2 - 17:2]
(word) ; [3:20 - 30:2]
(word) ; [3:31 - 45:2]
(word) ; [3:46 - 49:2]
(word) ; [3:50 - 61:2]
(word) ; [3:62 - 67:2]
(word) ; [3:68 - 71:2]
(word) ; [3:72 - 79:2]
(line) ; [4:1 - 1:4]
(taglink) ; [4:1 - 14:3]
text: (word) ; [4:2 - 13:3]
(word) ; [4:15 - 23:3]
(word) ; [4:24 - 27:3]
(word) ; [4:28 - 36:3]
Could nvim-treesitter
be interfering? I don't have it enabled.
n=1 for the culprit being nvim-treesitter
, I can recreate the problem with nvim-treesitter but not with the builtin parser.
I'm actually seeing this on my system, yes, and it's without nvim-treesitter. I'll try to paste the tree, but I'm getting an error traversing it right now (probably an unrelated regression from recent treesitter refactors):
Error detected while processing CursorMoved Autocommands for "<buffer=3>":
Error executing lua callback: /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:554: Invalid 'col': out of
range
stack traceback:
[C]: in function 'nvim_buf_set_extmark'
/usr/local/share/nvim/runtime/lua/vim/treesitter.lua:554: in function </usr/local/share/nvim/runtime/l
ua/vim/treesitter.lua:550>
(The error occurs when visiting the "weird" nodes, in particular keycode
.)
(block) ; [184:1 - 1:185]
(line) ; [184:1 - 1:184]
(word) ; [184:1 - 6:183]
(word) ; [184:7 - 16:183]
(word) ; [184:16 - 17:183]
(tag) ; [184:21 - 38:183]
text: (word) ; [184:22 - 37:183]
(block) ; [186:1 - 1:188]
(line) ; [186:1 - 1:187]
(h2) ; [186:1 - 1:187]
(tag) ; [187:1 - 7:186]
text: (word) ; [187:2 - 6:186]
(word) ; [187:9 - 13:186]
(word) ; [187:14 - 21:186]
(block) ; [189:1 - 1:191]
(line) ; [189:1 - 1:189]
(word) ; [189:1 - 4:188]
(word) ; [189:5 - 9:188]
(word) ; [189:10 - 16:188]
(word) ; [189:17 - 23:188]
(word) ; [189:24 - 28:188]
(word) ; [189:29 - 33:188]
(keycode) ; [189:34 - 40:188]
(word) ; [189:41 - 43:188]
(word) ; [189:44 - 45:188]
(word) ; [189:46 - 52:188]
(word) ; [189:53 - 58:188]
(word) ; [189:59 - 65:188]
(word) ; [189:66 - 69:188]
(word) ; [189:70 - 73:188]
(word) ; [189:74 - 77:188]
(line) ; [190:1 - 1:190]
(word) ; [190:1 - 7:189]
(word) ; [190:7 - 8:189]
(keycode) ; [190:9 - 15:189]
(word) ; [190:15 - 16:189]
(word) ; [190:17 - 31:189]
(word) ; [190:32 - 34:189]
(keycode) ; [190:35 - 49:189]
(word) ; [190:50 - 52:189]
(word) ; [190:53 - 55:189]
(word) ; [190:56 - 60:189]
(word) ; [190:61 - 63:189]
(word) ; [190:64 - 69:189]
(word) ; [190:70 - 73:189]
(word) ; [190:74 - 79:189]
(Weird, I never noticed that the row and column are flipped in the node range end, compared to the start. Also the start line seems 1-indexed and the end line 0-indexed?)
Update: copying the generated file into a fresh buffer works fine, so this may be a race condition? (Disabling and re-enabling treesitter doesn't make a difference, though.)
In particular, this means it's actually a Neovim issue, not a vimdoc issue.
But there is one minor issue: the LOCAL ADDITIONS:
are not parsed as a column heading due to the trailing colon ;)
The text changes based on installed plugins, so it's not always apparent. Minimal reproduction: