Skip to content

Add UndoManager undo_count() and redo_count()#725

Merged
zxch3n merged 1 commit into
loro-dev:mainfrom
renewedvision:undo-redo-counts
May 17, 2025
Merged

Add UndoManager undo_count() and redo_count()#725
zxch3n merged 1 commit into
loro-dev:mainfrom
renewedvision:undo-redo-counts

Conversation

@NSTroy
Copy link
Copy Markdown
Contributor

@NSTroy NSTroy commented May 16, 2025

Changes:

  • Surface the undo_stack and redo_stack depths
  • Add undo_count() and redo_count() checks to unit tests

This helps us use Loro's UndoManager as an alternative implementation of Cocoa Foundation's UndoManager API, which is obliged to be able to return an undoCount and redoCount.

@NSTroy
Copy link
Copy Markdown
Contributor Author

NSTroy commented May 16, 2025

This build failure seems unrelated to my change?

error: `#[must_use]` has no effect when applied to a provided trait method
   --> crates/delta/src/delta_item.rs:171:5

@zxch3n
Copy link
Copy Markdown
Member

zxch3n commented May 16, 2025

Yeah, I'm fixing that

@zxch3n
Copy link
Copy Markdown
Member

zxch3n commented May 16, 2025

Can you allow me to push to this branch @NSTroy

@NSTroy
Copy link
Copy Markdown
Contributor Author

NSTroy commented May 16, 2025

Can you allow me to push to this branch @NSTroy

@zxch3n I'll have to put in a request since I don't have the ability to grant permissions myself. It might be faster to fix the build issue separately; then, I'll happily rebase.

@zxch3n
Copy link
Copy Markdown
Member

zxch3n commented May 16, 2025

You can merge the main branch to fix the ci issue now

- Surface the undo_stack and redo_stack depths
- Add undo_count() and redo_count() checks to unit tests
@NSTroy NSTroy closed this May 17, 2025
@NSTroy NSTroy force-pushed the undo-redo-counts branch from ff46e27 to 7d28972 Compare May 17, 2025 00:43
@NSTroy NSTroy reopened this May 17, 2025
@zxch3n zxch3n merged commit 93fb2fd into loro-dev:main May 17, 2025
1 check passed
zxch3n pushed a commit to synoet/loro that referenced this pull request May 20, 2025
- Surface the undo_stack and redo_stack depths
- Add undo_count() and redo_count() checks to unit tests
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.

2 participants