 
         {node} = @
 
+        # whether found item is global and has no parent in NML
+        isMainItem = true
+
         if node instanceof Tag
             id = node.props[STYLE_ID_PROP]
             assert.isDefined id, "Tag must specify #{STYLE_ID_PROP} prop to create an item for it"

            # find parent if necessary or only update index for fixed parents
            if @isAutoParent
                @findItemParent()
            else
                @findItemIndex()

            # set node style

            [_, file, style, subid] = id.split(':')
            style ?= '_main'
            if subid
                isMainItem = false
                parentId = "styles:#{file}:#{style}"
                parent = @parent

