Skip to content

bpo-28097: IDLE - Add Previous/Next History to Shell menu #11325

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

Merged
merged 4 commits into from
Dec 28, 2018

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Dec 26, 2018

The first commit adds the entries the menu and the second commit grays out the entries when the shell is initially opened.

Some observations:

  • I thought about calling the menu items 'Previous Command' and 'Next Command' instead of using the word 'history'.
  • When a shell is restarted, the history isn't cleared.
  • Should there be a menu item to clear history on demand?
  • The history is always cyclic unless someone edits their config file by hand. Since it's not on configdialog to set it, I enable both menu entries whenever there is any history (since, when cyclic, there is always a Previous and Next entry). I think enabling the menu entries when the cyclic flag is False would best be handled at the time cyclic is added the condigdialog.
  • I added a new function to editor.py to update the state for the menu items. Because of this, I changed the recently added code for enabling/disabling the Code Context menu item to use this new function.

https://bugs.python.org/issue28097

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

The current line is part of the wraparound cycle, so the cycle is never empty and the short cuts always 'work' (rather than raising). So the new menu items should also.

Please move the typo fix and update_menu_state(), which we will need and its use in outwin to a new skip-news PR attached to issue 35555.

The result of both changes would be doc and mainmenu additions and the blurb.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@csabella
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@terryjreedy terryjreedy changed the title bpo-28097: IDLE: Add Previous/Next History to Shell menu bpo-28097: IDLE - Add Previous/Next History to Shell menu Dec 28, 2018
@terryjreedy terryjreedy merged commit c0381aa into python:master Dec 28, 2018
@miss-islington
Copy link
Contributor

Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

@terryjreedy: Please replace # with GH- in the commit message next time. Thanks!

@bedevere-bot
Copy link

GH-11345 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 28, 2018
…1325)

(cherry picked from commit c0381aa)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
miss-islington added a commit that referenced this pull request Dec 28, 2018
(cherry picked from commit c0381aa)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
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.

6 participants