DWilliames / paddy-sketch-plugin

Automated padding, spacing and alignment for your Sketch layers
MIT License
2.17k stars 61 forks source link

[Bug] 'Undo' not working correctly #47

Closed nakele closed 6 years ago

nakele commented 6 years ago

Bug report: History or cmd-z affected

Expected behavior: When using cmd-z it should go back 1 step in history when moving and deselecting objects.

Actual behavior: Once a box is moved and deselected few times to go back (cmd-z) takes many times, way more than the steps I've previously taken. This also affects cmd-shift-z to move forward in history.

(Please include a screenshot or screen recording if possible) Unzip, it's a video paddy bug.zip

Steps to reproduce: Move a box > deselect > wait few seconds > tap cmd-z > nothing happens

(Please attach a Sketch file if possible) It will happen on a fresh file of sketch 48.2

rorysmyth commented 6 years ago

+1 on this. Especially on larger stacks. Looks like every move is saved as a step in the history

scottwilliams58 commented 6 years ago

+1 from me too. It adds many invisible undo/history states and disables redo for me completely.

chrismackintosh commented 6 years ago

Same issue.

Dooode commented 6 years ago

Same here

c5inco commented 6 years ago

Yeah this is actually a big issue - almost a show stopper.

ibanbe commented 6 years ago

Same here. Yes, this is a huge problem guys. ezgif-4-42fb9e4989

matsaukeo commented 6 years ago

seeing the same issue

chrisaalid commented 6 years ago

Also seeing the same issue.

bbsody commented 6 years ago

Seeing the same issue.

DWilliames commented 6 years ago

Thanks everyone for this!! I will try and look into it ASAP — I know it's extremely frustrating and a really really bad bug 😢 😱

I can replicate this pretty easily too. In the mean time; I've found double-tapping 'Cmd + Z' seems to work.

djmtype commented 6 years ago

@DWilliames

In the mean time; I've found double-tapping 'Cmd + Z' seems to work.

No, pressing Cmd + Z twice consecutively does not Undo anything for me with Paddy enabled – at least in Sketch 49.

nakele commented 6 years ago

It's not a matter of double pressing cmd-z but pressing cmd-z fast enough, very quickly many times it will eventually go back in history

DWilliames commented 6 years ago

Alright all — I just release v1.0.5. Can you all please check if this has fixed it for you?

ibanbe commented 6 years ago

It's working fine now, thanks!!

rorysmyth commented 6 years ago

@DWilliames Seems to work, but introduced another one:

If you create a set of layers and group them (cmd+g), then cmd+r will not work. you need to unfocus the selection and reselect

nakele commented 6 years ago

@DWilliames seems to be working for me as well.

In relation to the cmd+r (rename) it seems that when Paddy plugin is enabled, grouping 2 elements and then hitting cmd+r won't do anything because both the group and 1 layer of the group are selected.

In comparison when the plugin is not enabled, grouping 2 elements and then renaming the group is allowed because only the group is selected.

Video attached. rename.mov.zip

DWilliames commented 6 years ago

Thanks all – I'll close this for now.

Thanks @rorysmyth and @nakele — I've created a new bug for this #62

Arkkimaagi commented 6 years ago

@DWilliames how did you fix this? I'm facing similar problems with a new plugin I'm writing and I can not figure out how you bypassed the undo trap. When ever the selection changes, I update text with a plugin. This causes similar problems with my plugin that yours had here. What did you do to go around this problem?