Closed andry81 closed 9 months ago
Hi andry81,
You were pretty close to the result. Just replace $1
with CAP1
.
The issue here is that $1
will not be resolved in the "Use Variables" environment. Therefore, it cannot be used in conditions or calculations. $1
can be passed through set
and cond
functions, and it is Notepad++ that finally resolves it. However, this can also cause trouble if you concatenate $1
with a trailing number.
So, always use CAP1
instead of $1
.
Besides that, there is also a CNT
variable. But your solution is better for your purposes!
Here is the correction:
$1
with CAP1
.BTTNCNT
to display as a whole number.Find what:
^(button|cmd|param|path|iconic|menu)\d*=
Replace with:
init({BTTNCNT=0}); if CAP1 == "button" then BTTNCNT=BTTNCNT+1 end; set(CAP1..string.format("%.0f", BTTNCNT).."=")
I will go to make the difference more clear in the README between $x and CAPx Variables.
Trying to renumber the ini keys from https://github.com/daddel80/notepadpp-multireplace/issues/31 with new syntax:
Find what:
Replace with:
But it does not seem to work.
The set always returns
.0=
.