Sublime Forum

Arithmetics: Loop numbers

#1

Hey everyone!
I am wondering, is the following output possible, where each new line is a new selection?
1
2
3
4
5
1
2
3
4
5
With i + 1 I am getting 1 to 10.
Something like math.wrap(i + 1, 5)?
Best wishes, Shu

0 Likes

#2

the modulo operator should work for this

(i % 5) + 1

3 Likes

Selecting multiple lines with a pattern
#3

@kingkeith
Yes, of course! Thanks! That does indeed work nicely!

0 Likes