Skip to content

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 <tjreedy@udel.edu>
@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 <tjreedy@udel.edu>
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 <tjreedy@udel.edu>
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