```lua
local x = 0
x += 1-- this is ok
local y = 0
print(y)
y += 1-- this is ok
local y = 0
y += 1-- one newline appears
local z = 0
--duplicate
z += 1--it copies the comments
local a = 0
--copies
--all
--comments
--in between
a += 1
```
```lua
local x = 0
x =x +1-- this is ok
local y = 0
print(y)
y =y +1-- this is ok
local y = 0
y =
y +1-- one newline appears
local z = 0
--duplicate
z =--duplicate
z +1--it copies the comments
local a = 0
--copies
--all
--comments
--in between
a =--copies
--all
--comments
--in between
a +1
```
```lua
local x = 0
x =x +1-- this is ok
local y = 0
print(y)
y =y +1-- this is ok
local y = 0
y =y +1-- one newline appears
local z = 0
--duplicate
z =z +1--it copies the comments
local a = 0
--copies
--all
--comments
--in between
a =a +1
```
Thank you for the detailed report, I can already see the fix for this issue. The rule is cloning the variable with all its token information. If it just cleared the tokens it'd probably fix all of this 🚀
How to replicate:
Results: