cshuaimin / ssr.nvim

Treesitter based structural search and replace plugin for Neovim.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unexpected behavior with reused placeholders

symphorien opened this issue · comments

Pattern

[SSR] 2/2 replaced (Press ? for help)    
SEARCH:                                  
$a = $a + $b;                            
REPLACE:                                 
$a += $b;                                
                       

used on rust buffer content:

fn main() {
    a = a + b;
    c = c + d;
}

yields the unexpected output:

fn main() {
    b += a = a + b;;
    d += c = c + d;;
}

instead of

fn main() {
    a += b;
    c += d;
}