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

IDLE right click outside of any selection should clear it #84066

Closed
terryjreedy opened this issue Mar 7, 2020 · 12 comments
Closed

IDLE right click outside of any selection should clear it #84066

terryjreedy opened this issue Mar 7, 2020 · 12 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 39885
Nosy @terryjreedy, @miss-islington
PRs
  • bpo-39885: IDLE context menu clears selection  #18859
  • [3.8] bpo-39885: IDLE context menu clears selection (GH-18859) #18860
  • [3.7] bpo-39885: IDLE context menu clears selection (GH-18859) #18861
  • bpo-39885: IDLE: Leave selection when right click within #18951
  • [3.9] bpo-39885: Make IDLE context menu cut and copy work again (GH-18951) #20522
  • [3.8] bpo-39885: Make IDLE context menu cut and copy work again (GH-18951) #20523
  • [3.7] bpo-39885: Make IDLE context menu cut and copy work again (GH-18951) #20524
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2020-05-29.23:31:23.218>
    created_at = <Date 2020-03-07.05:08:09.444>
    labels = ['type-bug', '3.8', '3.9', '3.10', 'expert-IDLE', '3.7']
    title = 'IDLE right click outside of any selection should clear it'
    updated_at = <Date 2020-05-29.23:31:23.216>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2020-05-29.23:31:23.216>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-05-29.23:31:23.218>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2020-03-07.05:08:09.444>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39885
    keywords = ['patch']
    message_count = 12.0
    messages = ['363577', '363578', '363580', '363581', '363675', '363676', '363677', '363991', '370337', '370339', '370340', '370341']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'miss-islington']
    pr_nums = ['18859', '18860', '18861', '18951', '20522', '20523', '20524']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39885'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

    @terryjreedy
    Copy link
    Member Author

    In text editors, right click commonly brings up a context menu, often including Cut, Copy, Paste, and Delete, with inapplicable entries grayed out. There are at least 2 'standard' behaviors (at least on Windows) with respect to the cursor and selections.

    0 (Examples: Windows Notepad and Firefox entry box). The cursor stays where it is and a selection stays selected, even if one has scrolled the cursor and possible selection off the screen with mousewheel or scrollbar. Paste inserts at the possibly hidden cursor, deleting any possibly hidden selection. The view jumps back to the cursor after Paste but not after Copy and Close (Esc).

    1 (Examples: Windows Notepad++ and Libre Office). The cursor jumps to the spot of the click, the same as with a left click. Any selection, possibly not visible, is unselected, the same as with a left click. Exception: a right click within an exception leaves the selection and cursor (at one of the ends) alone.

    IDLE follows a bit of each pattern and neither. Right click always moves the cursor, even within a selection, but never clears a selection. I believe that this is an accident of history. Originally, context menus only had 'Go to file/line' in Shell and grep output and 'Set/Clear Breakpoint' in editors. There was no reason to touch a selection even if the cursor was moved. Cut/Copy/Paste were added in 2012 because they are standard.

    To really be standard, right click should consistently act like left click and unselect. This prevents accidental deletion. This would also be consistent with making 'Go to line' act the same.

    Also, right click within a selection should not move the cursor.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Mar 7, 2020
    @terryjreedy terryjreedy self-assigned this Mar 7, 2020
    @terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes labels Mar 7, 2020
    @terryjreedy terryjreedy self-assigned this Mar 7, 2020
    @terryjreedy terryjreedy added topic-IDLE type-bug An unexpected behavior, bug, or error labels Mar 7, 2020
    @terryjreedy
    Copy link
    Member Author

    Spinoff from bpo-39852. At least the selection clear code added there should be pulled into a module level function and tested.

    @terryjreedy
    Copy link
    Member Author

    (Mozilla) Thunderbird, unlike (Mozilla) Firefox, has move/clear right clicks.

    @terryjreedy terryjreedy changed the title IDLE right click should unselect IDLE right click should clear any selection Mar 7, 2020
    @terryjreedy terryjreedy changed the title IDLE right click should unselect IDLE right click should clear any selection Mar 7, 2020
    @terryjreedy
    Copy link
    Member Author

    I believe the following is true: when only one selection is allowed, the cursor is normally at one end or the other, and any cursor movement either clear the selection or changes its range.

    @terryjreedy
    Copy link
    Member Author

    New changeset 4ca060d by Terry Jan Reedy in branch 'master':
    bpo-39885: IDLE context menu clears selection (bpo-18859)
    4ca060d

    @miss-islington
    Copy link
    Contributor

    New changeset f9684d2 by Miss Islington (bot) in branch '3.7':
    bpo-39885: IDLE context menu clears selection (GH-18859)
    f9684d2

    @miss-islington
    Copy link
    Contributor

    New changeset b2e8240 by Miss Islington (bot) in branch '3.8':
    bpo-39885: IDLE context menu clears selection (GH-18859)
    b2e8240

    @terryjreedy
    Copy link
    Member Author

    Restore not clearing the selection when click within it. See Exception in 1 above. Users need to continue to see what will be copied or cut (which also happens with paste).

    The breakpoint toggle and goto file/line options on the context menu need the line number of the click. If the cursor is not moved, another alternative is needed.

    @terryjreedy terryjreedy reopened this Mar 12, 2020
    @terryjreedy terryjreedy reopened this Mar 12, 2020
    @terryjreedy terryjreedy changed the title IDLE right click should clear any selection IDLE right click outside of any selection should clear it Mar 12, 2020
    @terryjreedy terryjreedy changed the title IDLE right click should clear any selection IDLE right click outside of any selection should clear it Mar 12, 2020
    @terryjreedy
    Copy link
    Member Author

    New changeset 97e4e0f by Terry Jan Reedy in branch 'master':
    bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
    97e4e0f

    @miss-islington
    Copy link
    Contributor

    New changeset 80b6a05 by Miss Islington (bot) in branch '3.7':
    bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
    80b6a05

    @miss-islington
    Copy link
    Contributor

    New changeset 3dcccd1 by Miss Islington (bot) in branch '3.8':
    bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
    3dcccd1

    @miss-islington
    Copy link
    Contributor

    New changeset 9f3f70f by Miss Islington (bot) in branch '3.9':
    bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
    9f3f70f

    @terryjreedy terryjreedy added the 3.10 only security fixes label May 29, 2020
    @terryjreedy terryjreedy added the 3.10 only security fixes label May 29, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants