From b60aed28e7cacb1fc1544761b639ace2d6d324aa Mon Sep 17 00:00:00 2001 From: origami-z <5257855+origami-z@users.noreply.github.com> Date: Tue, 18 Jun 2024 09:12:41 +0100 Subject: [PATCH] Skip empty cells --- .../copy-manager/plugin-src/processors/csvProcessor.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/copy-manager/plugin-src/processors/csvProcessor.ts b/packages/copy-manager/plugin-src/processors/csvProcessor.ts index efeff80..6d606bf 100644 --- a/packages/copy-manager/plugin-src/processors/csvProcessor.ts +++ b/packages/copy-manager/plugin-src/processors/csvProcessor.ts @@ -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"; @@ -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),