Plugin breaks undo #16

Closed
TobiasBerg opened this Issue Dec 14, 2012 · 5 comments

Comments

Projects
None yet
4 participants
@TobiasBerg

After installing GitGutter I've noticed that the undo feature breaks normal behavior.

If I write some text and try to undo it, instead of removing the whole text it removes one letter at a time.

To reproduce:
Write some text
Hit undo.
Notice behavior.
Install GitGutter
Write some text
Hit undo.
Notice the different behavior

This was tested on a Mac.

@samueljohn

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Dec 14, 2012

I think, I observed this, too but I didn't recognize. Good catch.

I think, I observed this, too but I didn't recognize. Good catch.

@jisaacks

This comment has been minimized.

Show comment
Hide comment
@jisaacks

jisaacks Dec 15, 2012

Owner

This is happening because an event listener is being fired on every modification. Not sure if there is anything that can be done about that, and it actually sounds like a possible sublime bug.

If you don't like it, you can turn off Git Gutter's live mode in your Package.sublime-settings file:

"git_gutter_live_mode": false

Your undo will work normal again.

Owner

jisaacks commented Dec 15, 2012

This is happening because an event listener is being fired on every modification. Not sure if there is anything that can be done about that, and it actually sounds like a possible sublime bug.

If you don't like it, you can turn off Git Gutter's live mode in your Package.sublime-settings file:

"git_gutter_live_mode": false

Your undo will work normal again.

@kfuglsang

This comment has been minimized.

Show comment
Hide comment
@kfuglsang

kfuglsang Dec 17, 2012

Even when disabling live mode, the undo behavior is affected. I noticed that the chunks that are being undone are much larger when GitGutter is installed.

Without GitGutter installed, Sublime undoes one word at a time.

I'm on Windows 8 x64 btw.

Even when disabling live mode, the undo behavior is affected. I noticed that the chunks that are being undone are much larger when GitGutter is installed.

Without GitGutter installed, Sublime undoes one word at a time.

I'm on Windows 8 x64 btw.

frantic added a commit to frantic/GitGutter that referenced this issue Dec 17, 2012

Fixed Sublime's undo when GitGutter is active
Seams like the problem was in `run_command` which creates new edit,
thus making every char input separate. In that case every Undo
reverted symbol-by-symbol changes.

This commit separates GitGutter logic from Sublime's TextCommand, so
it can be directly invoked on view

Related issue: #16
@jisaacks

This comment has been minimized.

Show comment
Hide comment
@jisaacks

jisaacks Dec 19, 2012

Owner

This is fixed with #22

Owner

jisaacks commented Dec 19, 2012

This is fixed with #22

@jisaacks jisaacks closed this Dec 19, 2012

@samueljohn

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Dec 20, 2012

Confirmed. Fixed. Thanks!

Confirmed. Fixed. Thanks!

dichlofos referenced this issue in dichlofos/VcsGutter Jul 4, 2013

dichlofos referenced this issue in dichlofos/VcsGutter Jul 4, 2013

dichlofos referenced this issue in dichlofos/VcsGutter Jul 4, 2013

dichlofos referenced this issue in dichlofos/VcsGutter Jul 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment