Sublime-Text-2-Inc-Dec-Value icon indicating copy to clipboard operation
Sublime-Text-2-Inc-Dec-Value copied to clipboard

Cursor duplicates on decreacement

Open AllanLRH opened this issue 11 years ago • 9 comments

Suppose I have the following code, where the | is a the caret:

adIdx = [ idx + [ |0 -1]
          idx + [ 0  1]
          idx + [ 0  1] ];

Activete decrease value by 1 once, and get this:

adIdx = [ idx + [ |-|2 -1]
          idx + [ 0  1]
          idx + [ 0  1] ];

I hoped to get this instead:

adIdx = [ idx + [ |-1 -1]
          idx + [ 0  1]
          idx + [ 0  1] ];

AllanLRH avatar Oct 07 '13 15:10 AllanLRH

I can't reproduce the bug, but I found another (

rmaksim avatar Oct 27 '13 20:10 rmaksim

Wierd – I still have the problem when the increment/decreament changes the number of digits. I checked (md5 checksum) that I have the same of the python file as in this repository. Here I do increments with three cursors, invoking the command four times (the grey numbers are the line numbers in ST): small_1_inc008 small_2_inc016 smalllll smalllll small_4_inc028

Seems like the cursors is duplicated when the number of digits is increaced, and since the command is applied once per cursor, the command is applied twice to the number with two cursors.

AllanLRH avatar Mar 03 '14 14:03 AllanLRH

sorry ( I steel can't reproduce the bug. I can't understand what it can be. Why cursor is duplicated in the first line. If you try in a different order (10 9 11) - the same problem at 9 ?

rmaksim avatar Mar 03 '14 20:03 rmaksim

Yup, same thinng happens when I shuffle the top and middle line. But since you can't reprouce the error, my best guess is that I have some other plugin which is interfering with this plugin.

A strange thing is that this only happens when I put my cursor in front of the number to be incremented/decremented. When the cursor is behind the number, it works just fine.

AllanLRH avatar Mar 03 '14 22:03 AllanLRH

I still have this bug (using Sublime Text 3). My guess is that increase/decrease the command is sequentially executed for every cursor in the buffer. When the cursor is placed in front of a number which is being increased or decreased to a value which causes the length of the string representation of that number to increase, another cursor is spawned inside the number, and the command is thus executed for this cursor as well, since it's the next cursor in line.

AllanLRH avatar Dec 03 '15 11:12 AllanLRH

Try update for v0.1.19

I steel can't reproduce the bug. But again I found another similar bug (

rmaksim avatar Dec 03 '15 20:12 rmaksim

Had same problem. image

webcaetano avatar Jul 04 '16 21:07 webcaetano

Hello! Someone has the same problem?

rmaksim avatar Aug 16 '16 19:08 rmaksim

Hi, Yes I am having the same issue, in both increase and decrease (e.g., |9|1|1). Under ST3 dev version, Linux, Ubuntu 15.10.

Naereen avatar Nov 02 '16 21:11 Naereen