tisho / sketch-plugins

A collection of plugins for Bohemian Coding's Sketch.
645 stars 25 forks source link

text layers don't sync correctly when deleted #8

Open ianleighton opened 10 years ago

ianleighton commented 10 years ago

Steps: 1 I created a group with 5 text labels, named and in something like this arrangement:

$label        $yetanotherlabel   $label2
$otherlabel                      $otherlabel2

(sorry, can't get GFM tables to work) 2 name the group "group : row" 3 copy the group multiple times (4 or so) 4 delete $label2 and $otherlabel2 from one of the groups

$label             $yetanotherlabel
$otherlabel 

5 sync

Unexpected Result: instead of $label2 and $otherlabel2 being deleted, $yetanotherlabel was deleted, and $label2 was moved into its place, so instead of the expected result of step 4, we have :

$label           $label2
$otherlabel
tisho commented 10 years ago

The dynamic layer sync is undergoing a rewrite for the next release. Hopefully it will resolve the issue you're talking about. Thanks for reporting it!

ianleighton commented 10 years ago

Since I reported it I've had a few other weird things happen that seem to be related (and a couple crashes), so hopefully the rewrite will kill all those bugs.

Looking forward to it!

On Jan 9, 2014, at 11:46, Tisho Georgiev notifications@github.com wrote:

The dynamic layer sync is undergoing a rewrite for the next release. Hopefully it will resolve the issue you're talking about. Thanks for reporting it!

— Reply to this email directly or view it on GitHub.

Arkkimaagi commented 10 years ago

tisho, I think it could also be related to this:

if(protectedLayerNames.indexOf(name) !== -1) {

indexOf seems a bit weird choice here, as it may match the beginning of the label here like:

"$label2".indexOf("$label") // returns 0, as the string indeed starts with $label
Arkkimaagi commented 10 years ago

No, sorry, my bad. This probably is not related to my thing, I think the indexOfmight cause some other issues. (maybe)

tisho commented 10 years ago

@Arkkimaagi: indexOf is called on the array, not the string :) It makes sense in that case, because I'm trying to figure out if the layer in the current iteration is one of the protectedLayerNames.

Arkkimaagi commented 10 years ago

Doh, my bad :)