Skip to content

bpo-39781: Do not jump when select in IDLE codecontext #18683

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 6 commits into from
Feb 28, 2020

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Feb 28, 2020

Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection

https://bugs.python.org/issue39781

@terryjreedy
Copy link
Member Author

I think that this is ready to merge (tomorrow). The main problem I had is that 'sel' is a tag for some purposes, like tag_add, but tag_prevrange('sel', '1.0') returns an empty tuple even when there is a selection. After failing to make it work, I found a solution in EditorWindow.get_selection_indices. Text.selection_get also works (and also raises TclError when no selection).

@python python deleted a comment from codecov bot Feb 28, 2020
"""
try:
self.context.index("sel.first")
except tkinter.TclError:
Copy link
Member Author

Choose a reason for hiding this comment

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

Everything after this is the old code indented.

@terryjreedy terryjreedy merged commit c705fd1 into python:master Feb 28, 2020
@miss-islington
Copy link
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-18688 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-18689 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 Feb 28, 2020
Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
(cherry picked from commit c705fd1)

Co-authored-by: Terry Jan Reedy <[email protected]>
@terryjreedy terryjreedy deleted the context_select branch February 28, 2020 18:24
miss-islington added a commit that referenced this pull request Feb 28, 2020
Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
(cherry picked from commit c705fd1)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Feb 28, 2020
Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
(cherry picked from commit c705fd1)

Co-authored-by: Terry Jan Reedy <[email protected]>
sthagen added a commit to sthagen/python-cpython that referenced this pull request Feb 28, 2020
bpo-39781: Do not jump when select in IDLE codecontext (pythonGH-18683)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants