Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Operation::Load to History #877

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

MitMaro
Copy link
Owner

@MitMaro MitMaro commented Jul 21, 2023

Add to the todo_file History a load operation tracker, that will acts as a sentinel value for the start of the undo history queue. This will enable hooking into the start of the history queue. In order to expose the additional information, the Operation is now returned from the History undo/redo methods.

self.history.undo(&mut self.lines)
if let Some((operation, start, end)) = self.history.undo(&mut self.lines) {
return if operation == Operation::Load {
None
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@forivall , for #873 , I think you should be able to call detect_state here, to reset the state back to the initial state.

Thoughts?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, that seems correct

@coveralls
Copy link

coveralls commented Jul 21, 2023

Pull Request Test Coverage Report for Build 5726345979

  • 23 of 24 (95.83%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 94.212%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/todo_file/src/lib.rs 6 7 85.71%
Totals Coverage Status
Change from base Build 5726333442: -0.004%
Covered Lines: 4704
Relevant Lines: 4993

💛 - Coveralls

Add to the todo_file History a load operation tracker, that will acts as
a sentinel value for the start of the undo history queue. This will
enable hooking into the start of the history queue. In order to expose
the additional information, the Operation is now returned from the
History undo/redo methods.
@MitMaro MitMaro force-pushed the mitmaro/add-operation-result-from-list-history branch from 1b2e6cb to 4c593d7 Compare August 1, 2023 11:47
@MitMaro MitMaro merged commit 2bf09e1 into master Aug 1, 2023
8 checks passed
@MitMaro MitMaro deleted the mitmaro/add-operation-result-from-list-history branch August 1, 2023 11:58
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.

None yet

3 participants