Add a way to customize the location where the treesitter tree traversal is started (currently only on the first non-blank char on the cursor's line). This would make it possible to comment something like this in JSX when running gciW:
<View /* style={styles.foobar} */ />
I think that it would make sense if update_commentstring would accept the position as an argument. If nothing passed in, then the cursor start of line, but if there is some location passed in, then we can use that one. For example, the Comment.nvim integration can use getpos("'<") to get the visual selection start location instead of the cursor location. Or if there's no visual selection, then for the above example use the cursor location (or motion start location somehow?).
Original issue / problem: https://github.com/numToStr/Comment.nvim/issues/10#issuecomment-945556118
Add a way to customize the location where the treesitter tree traversal is started (currently only on the first non-blank char on the cursor's line). This would make it possible to comment something like this in JSX when running
gciW
:I think that it would make sense if
update_commentstring
would accept the position as an argument. If nothing passed in, then the cursor start of line, but if there is some location passed in, then we can use that one. For example, theComment.nvim
integration can usegetpos("'<")
to get the visual selection start location instead of the cursor location. Or if there's no visual selection, then for the above example use the cursor location (or motion start location somehow?).