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

Cleanup in undo in TextEdit and LineEdit #86085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheSofox
Copy link
Contributor

In both TextEdit and LineEdit, the Undo and Redo functions seemed to check for themselves whether there was an Undo/Redo available rather than using the existing has_undo or has_redo functions. I decided to make them use them to remove repetition.

Only exception was the TextEdit Undo function. I noticed its check for an Undo was slightly different from the has_undo function. I decided to leave it alone.

@@ -4024,7 +4024,7 @@ void TextEdit::redo() {
}
_push_current_op();

if (undo_stack_pos == nullptr) {
if (!has_redo()) {
Copy link
Member

Choose a reason for hiding this comment

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

Should the same change be done in undo()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants