abecodes/tabout.nvim

Tubout inside Rust macro

kolach opened this issue · 1 comments

kolach commented

I notice incorrect behavior of Tabout inside Rust macro. Let's take a simple oneline example:

format!("{:x}", hash_result);

Suppose I signifies cursor position before Tabout command is executed:

 format!("{:x}|", hash_result)

Now I click Tab and cursor gets to the end like this:

format!("{:x}", hash_result)|

rather than expect after ":

format!("{:x}"|, hash_result)

Is it possible to fix with some configuration?

Hi @kolach ,

totally forgot to answer, sorry :(

Thats how treesitter defines this node for rust. To change that, you could either create a PR to treesitter to change that, or PR to tabout which checks if we use rust, if we are in a makro, and if we are in the string argument. Then we would need some checking of the chars if it is indeed the string argument, etc.
Feel free to give it a try and create a PR 👍

Happy holidays and stay healthy