markdown-togglecheck
markdown-togglecheck copied to clipboard
Wrong box is toggled if cursor is to the left of the box
I have noticed a small bug: if the cursor is on the line one wishes to toggle, but to the left of the box, then running the plugin toggles the line above rather than the line the cursor is on.
well, that's because we don't really have an easy way to detect treesitter nodes on current line rather than under cursor. The item begins from its marker so everything before it is treated as previous node.
The behaviour is kinda inconvenient tho, I'll try to come up with something. For now you can do something like going to the end of a line / to a list marker when toggling via mapping. Something like that:
vim.api.nvim_set_keymap('n', '<leader>nn', '$:lua require("markdown-togglecheck").toggle()<CR>')