-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-66136: IDLE: Fix use of unsaved indicator in titlebar of shell window #3701
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
Open
csabella
wants to merge
1
commit into
python:main
Choose a base branch
from
csabella:shell_save
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,12 +47,19 @@ def dump_event(self, event): | |
| pprint(self.undolist[self.pointer:]) | ||
| return "break" | ||
|
|
||
| def reset_undo(self): | ||
| def reset_undo(self, set_saved_flag=True): | ||
| """Reset the undo/redo history. | ||
|
|
||
| Clear the undo/redo history and optionally set the saved | ||
| status for the window based on the parameter. If set_saved_flag | ||
| is True, then the window will look like it's been saved. If | ||
| it's false, it will not be flagged as saved. | ||
| """ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe replacing the 4 lines with "If set_saved_flag, clear the unsaved markers on the title bar." gives the essential additional information needed. |
||
| self.was_saved = -1 | ||
| self.pointer = 0 | ||
| self.undolist = [] | ||
| self.undoblock = 0 # or a CommandSequence instance | ||
| self.set_saved(1) | ||
| self.set_saved(set_saved_flag) | ||
|
|
||
| def set_saved(self, flag): | ||
| if flag: | ||
|
|
@@ -355,6 +362,8 @@ def _undo_delegator(parent): # htest # | |
| undo.pack(side='left') | ||
| redo = Button(undowin, text="Redo", command=lambda:d.redo_event(None)) | ||
| redo.pack(side='left') | ||
| reset = Button(undowin, text="Reset Undo", command=lambda:d.reset_undo()) | ||
| reset.pack(side='left') | ||
| dump = Button(undowin, text="Dump", command=lambda:d.dump_event(None)) | ||
| dump.pack(side='left') | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix use of unsaved indicator in titlebar of shell window. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and delete rest. I will soon propose changing handing of prompt.