Skip to content

IDLE: Goto should remove selection and update the status bar #84033

Closed

Description

@DaveLiptack
BPO 39852
Nosy @gvanrossum, @terryjreedy, @miss-islington
PRs
  • bpo-39852: IDLE 'Go to line' deletes selection, updates status #18801
  • [3.8] bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) #18857
  • [3.7] bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801) #18858
  • Files
  • selection_clear.py
  • 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-03-08.18:51:40.174>
    created_at = <Date 2020-03-04.18:12:17.807>
    labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
    title = 'IDLE: Goto should remove selection and update the status bar'
    updated_at = <Date 2020-03-09.20:46:53.135>
    user = 'https://bugs.python.org/DaveLiptack'

    bugs.python.org fields:

    activity = <Date 2020-03-09.20:46:53.135>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-03-08.18:51:40.174>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2020-03-04.18:12:17.807>
    creator = 'Dave Liptack'
    dependencies = []
    files = ['48957']
    hgrepos = []
    issue_num = 39852
    keywords = ['patch']
    message_count = 15.0
    messages = ['363370', '363392', '363439', '363457', '363487', '363490', '363514', '363579', '363670', '363671', '363672', '363691', '363695', '363740', '363770']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'terry.reedy', 'miss-islington', 'Dave Liptack']
    pr_nums = ['18801', '18857', '18858']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39852'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. DaveLiptack commented on Mar 4, 2020

      DaveLiptackmannequin
      MannequinAuthor

      Python 3.8.1
      IDLE 3.8.1

      When COPYing text in IDLE, right-click and PASTE behaves like CUT/PASTE

      This also occurs with COPY -> Go to Line -> PASTE

      This does not occur with COPY -> left-click -> PASTE

    2. added
      type-bug
      on Mar 4, 2020
    3. terryjreedy commented on Mar 4, 2020

      @terryjreedy
      Member

      The standard and expected behavior is that pasting *without* a selection inserts, pasting *with* a selection replaces. Pasting with key, Edit menu, or context menu should be the same. This is what I see and what I *think* you are describing. If so, please close. If not, please specify OS and version, how you installed Python, and more concretely what you did and whether line numbers or code context were present.

    4. DaveLiptack commented on Mar 5, 2020

      DaveLiptackmannequin
      MannequinAuthor

      OS: Windows 10 Pro
      Version: 1909
      OS Build: 18363.657

      Python 2.7.17 and 3.8.1 were installed from https://www.python.org/downloads/ using the Windows x86-64 executable installer (3.8.1) and Windows x86-64 MSI installer (2.7.17)

      Both line numbers and code context are not present

      To reproduce:

      1. Position cursor at the start of a line of text
      2. Type Shift+down arrow (to select line of text)
      3. Type Ctrl+c
      4. Type Alt+g (IDLE) or Ctrl+g (Notepad, Notepad++)
      5. Enter line number (for example below line number = 2)
      6. Type Enter
      7. Type Ctrl+v

      Example initial text:
      # This is line 1

      # additional line
      # This is a line I wish to duplicate
      # another additional line

      Resulting text in IDLE:
      # This is line 1
      # This is a line I wish to duplicate

      # additional line
      # another additional line

      Resulting text in Notepad and Notepad++:
      # This is line 1
      # This is a line I wish to duplicate

      # additional line
      # This is a line I wish to duplicate
      # another additional line

      My workaround in IDLE is to add a step between #6 and #7 above, where I mouse click at the desired paste location

    5. terryjreedy commented on Mar 5, 2020

      @terryjreedy
      Member

      This is much clearer. To expand on what I said before, inserting *anything*, such as by hitting a key, replaces a selection. I verified that this is normal behavior, at least on Windows, with Notepad, Notepad++, and this Firefox entry box I am typing in. So either of your steps 6 or 7 delete the still selected line, after the goto. (And so a click is needed before 6 to stop the deletion.) I see the continued selection as the problem. Both Notepad and Notepad++ unselect any selection upon goto, the same as if one moved the cursor by clicking instead of goto.

      I will try adding text.selection_clear() to the goto code.

    6. added
      3.7 (EOL)
      3.9 (EOL)
      on Mar 5, 2020
    7. changed the title [-]IDLE: Copy/Paste behaves like Cut/Paste[/-] [+]IDLE: Goto should remove any selection[/+] on Mar 5, 2020
    8. added
      3.7 (EOL)
      3.9 (EOL)
      on Mar 5, 2020
    9. 2 remaining items

    10. terryjreedy commented on Mar 6, 2020

      @terryjreedy
      Member

      I am expanding this issue to include the part of bpo-27115 that the PR will fix. (I will also change the scope of the latter).

    11. changed the title [-]IDLE: Goto should remove any selection[/-] [+]IDLE: Goto should remove selection and update the status bar[/+] on Mar 6, 2020
    12. changed the title [-]IDLE: Goto should remove any selection[/-] [+]IDLE: Goto should remove selection and update the status bar[/+] on Mar 6, 2020
    13. DaveLiptack commented on Mar 6, 2020

      DaveLiptackmannequin
      MannequinAuthor

      Like goto, right-click also exhibits this behavior. Should selection_clear also be added to right-click code?

    14. terryjreedy commented on Mar 7, 2020

      @terryjreedy
      Member

      Agreed about right clicks. See new issue bpo-39885.

    15. terryjreedy commented on Mar 8, 2020

      @terryjreedy
      Member

      New changeset 2522db1 by Terry Jan Reedy in branch 'master':
      bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
      2522db1

    16. miss-islington commented on Mar 8, 2020

      @miss-islington
      Contributor

      New changeset a5e821c by Miss Islington (bot) in branch '3.8':
      bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
      a5e821c

    17. miss-islington commented on Mar 8, 2020

      @miss-islington
      Contributor

      New changeset ec61f53 by Miss Islington (bot) in branch '3.7':
      bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
      ec61f53

    18. gvanrossum commented on Mar 9, 2020

      @gvanrossum
      Member

      I have a nit on the commit message used here (and also in bpo-39885). *Please* don't use this style of commit message "IDLE context menu clears selection". That phrasing sounds like it is the description of a bug. Please always use a phrasing that makes it clear what the commit/PR changes. In this case, for example, it could be "IDLE: make context menu clear selection".

      I know there are projects that prefer this style. Python is not one of them. Please comply.

    19. terryjreedy commented on Mar 9, 2020

      @terryjreedy
      Member

      Is it the temporal ambiguity (fixed by adding 'now', which is in the blurbs) or the descriptive versus command style (as with 'Returns' versus 'Return') that you do not like? If the latter, the devguide could use augmentation.

      The only relevant 'guidance' I found is this descriptive example in https://devguide.python.org/pullrequest/#making-good-commits: "the spam module is now more spammy". This seems similar to "IDLE context menu now clears selection". I don't see anything about commit messages in https://devguide.python.org/committing/, which seems like another likely place for such.

    20. gvanrossum commented on Mar 9, 2020

      @gvanrossum
      Member

      I guess it's similar to the 'return' vs. 'returns' issue, but I feel much
      stronger about it here.

      I would have written that as "make the spam module more spammy". Just read
      a bunch of commits using e.g. git log --oneline to see what the
      prevailing style is.

    21. terryjreedy commented on Mar 9, 2020

      @terryjreedy
      Member
    22. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)3.8 (EOL)3.9 (EOL)topic-IDLEtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions