Skip to content

Commit

Permalink
Only count a layer as having been renamed if its name differed from t…
Browse files Browse the repository at this point in the history
…he original symbol
  • Loading branch information
lewishowles committed Dec 21, 2024
1 parent afa8849 commit 486fe43
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.1.1

The plugin longer renames all layers regardless, allowing feedback to be more relevant.

## v.0.1.0

This initial release of Sketch nudge font size adds one command:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/rename-symbol-instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export default function() {
function renameSymbolInstances(layers) {
layers.forEach(layer => {
if (layer.type === 'SymbolInstance') {
layer.name = layer.master.name;
count++;
if (layer.name !== layer.master.name) {
layer.name = layer.master.name;
count++;
}
} else if (layer.layers && layer.layers.length > 0) {
renameSymbolInstances(layer.layers);
}
Expand Down

0 comments on commit 486fe43

Please sign in to comment.