Skip to content

Commit

Permalink
Skip empty cells
Browse files Browse the repository at this point in the history
  • Loading branch information
origami-z committed Jun 18, 2024
1 parent f72918c commit b60aed2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/copy-manager/plugin-src/processors/csvProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import {
} from "./iterate";

const getListOption = (node: TextNode): string => {
if (node.characters.length === 0) {
return "NONE";
}
const fullListOption = node.getRangeListOptions(0, node.characters.length);
if (fullListOption === figma.mixed) {
return "MIXED";
Expand Down Expand Up @@ -201,6 +204,11 @@ export const csvTextNodeUpdater = async (

const newChar = getCharToUse(nodeInfo, settings);

if (nodeInfo.characters.length === 0 && newChar.length === 0) {
// skip empty cells
return [];
}

const updated = [
await updateCharacters(node, newChar),
await updateListOption(node, nodeInfo),
Expand Down

0 comments on commit b60aed2

Please sign in to comment.