Skip to content

Fix internal copy/paste losing block styles across documents#125

Merged
krperry merged 1 commit into
mainfrom
copy_source_style
May 28, 2026
Merged

Fix internal copy/paste losing block styles across documents#125
krperry merged 1 commit into
mainfrom
copy_source_style

Conversation

@krperry
Copy link
Copy Markdown
Collaborator

@krperry krperry commented May 28, 2026

I had to Move clips and lastCopiedString from instance to
companion object so clipboard state is shared across the manager
which made it possible to copy styles across internal documents.

When pasting a STYLE block, copy `the attributes
bb:type
utd:overrideStyle
from the clipboard element to the destination block so the source
style is preserved instead of defaulting to Body Text

Caused a crash and learned I had to Skip PAGE_NUM blocks and
UTD-namespace elements because navigating to elements that have no
TextMapElement in the text view

Found another crash when I was getting ready to commit and the context menu rebuild is run on a blank document after paste. it was caused by an empty map list but I only got this because of my debug messages but I fixed it anyway.

I had to Move `clips` and `lastCopiedString` from instance to
  companion object so clipboard state is shared across the manager
  which made it possible to copy styles across internal documents.

  When pasting a STYLE block, copy `the attributes
  bb:type
  utd:overrideStyle
    from the clipboard element to the destination block so the source
  style is preserved instead of defaulting to Body Text

  Caused a crash and learned I had to Skip PAGE_NUM blocks and
  UTD-namespace elements because navigating to elements that have no
  TextMapElement in the text view

  Found another crash when I was getting ready to commit and  the context menu rebuild is run on a blank document after paste.   it was caused by an empty map list but I only  got this because of my debug messages but I fixed it anyway.
@krperry krperry merged commit b5c60ca into main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant