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: Replace selected not working/consistent with find #57795

Closed
marco mannequin opened this issue Dec 12, 2011 · 9 comments
Closed

IDLE: Replace selected not working/consistent with find #57795

marco mannequin opened this issue Dec 12, 2011 · 9 comments
Assignees
Labels
3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@marco
Copy link
Mannequin

marco mannequin commented Dec 12, 2011

BPO 13586
Nosy @terryjreedy, @serwy, @roseman, @ZackerySpytz
PRs
  • gh-57795: IDLE: Enter the selected text when opening the "Replace" dialog #17593
  • Files
  • issue13586.patch
  • find_keep_open.patch
  • 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 = None
    created_at = <Date 2011-12-12.05:41:52.415>
    labels = ['expert-IDLE', 'type-bug', '3.7']
    title = 'IDLE: Replace selected not working/consistent with find'
    updated_at = <Date 2019-12-13.19:55:46.493>
    user = 'https://bugs.python.org/marco'

    bugs.python.org fields:

    activity = <Date 2019-12-13.19:55:46.493>
    actor = 'ZackerySpytz'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2011-12-12.05:41:52.415>
    creator = 'marco'
    dependencies = []
    files = ['24003', '24016']
    hgrepos = []
    issue_num = 13586
    keywords = ['patch']
    message_count = 9.0
    messages = ['149276', '149647', '149663', '149697', '149734', '149735', '149737', '149812', '358353']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'roger.serwy', 'markroseman', 'marco', 'ZackerySpytz']
    pr_nums = ['17593']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue13586'
    versions = ['Python 3.6', 'Python 3.7']

    Linked PRs

    @marco
    Copy link
    Mannequin Author

    marco mannequin commented Dec 12, 2011

    Entering the Replace dialog (by ctrl+h or from Edit/Replace... menu) with a selection does not auto-magically have the selected text in the find field.

    This is not consistent with the other find functions (ctrl+f: Find...; alt+F3: Find in Files...; ctrl+F3: Find Selection) where the highlighted text automatically entered in the find field.

    @marco marco mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Dec 12, 2011
    @terryjreedy
    Copy link
    Member

    In 3.2 on Win 7, selected text *is* put in the 'find' field of Replace boxes, just as with Find boxes, just as it should be. So there is something specific either to 2.7 (which is unusual, since the code base in mostly the same, but possible) or to your OS. What are you running Python with?

    @terryjreedy terryjreedy changed the title Replace selected not working/consistent with find IDLE: Replace selected not working/consistent with find Dec 17, 2011
    @marco
    Copy link
    Mannequin Author

    marco mannequin commented Dec 17, 2011

    Win 7 Pro 32bit.

    @serwy
    Copy link
    Mannequin

    serwy mannequin commented Dec 17, 2011

    On Linux using 2.7.1 and 3.2, the Replace dialog does not contain the selected text in the Find field.

    The find functionality that copies the selected text was introduced in 868ff0dfabd2 on 2002-11-06. Unfortunately it wasn't added to the Replace Dialog code. The attached patch (against 3.3a0) adds this functionality to Replace Dialog and also removes some non-functional (arguably broken) code.

    @marco
    Copy link
    Mannequin Author

    marco mannequin commented Dec 18, 2011

    To check on 3.2 I installed a fresh Python 3.2.1.1 on Win7 x86 32bit and it has the same problem.
    So this issues is valid on 2.7.2.1 and 3.2.1.1
    I --dry-run Roger patch on both 2.7 and 3.2 with no errors or warnings messages and after patching it fixes the issue on both versions.

    @terryjreedy
    Copy link
    Member

    I am running 3.2.2 on 64-bit Win7Pro, which should not make a difference. So why did ^H work right for me yesterday and not for Marco today.

    Retrying with fresh IDLEs I discovered the following: selections do not initially appear in the find part of a Replace box (^H). But after selecting and opening a Find box (^F) with something selected, the same text appears in Replace boxes regardless of the actual selection, even if there is no selection -- until another Find box is opened.

    So I was fooled yesterday because I tried ^F first to see what the 'correct' behavior was and then did ^H with the same selection. And I did the same in both Shell and Edit windows. When testing, order matters ;-).

    I discovered something else I am not sure is what we want. Clicking Find in a Replace box leaves the box open so one can Find again. Clicking Find in a Find box closes it. So you need ^F and Find to re-search.

    @marco
    Copy link
    Mannequin Author

    marco mannequin commented Dec 18, 2011

    To follow on Terry thought, I think find dialog box should stay open when 'Find' button is pressed, since there is a 'close' button to close it.
    That would also be a more accepted behavior similar to all the other editors I know.

    And on silly UI design notes:
    The 'close' button should be at the bottom instead of the top (and have a capital C)
    ctrl+f 'Find' button should say 'Find Next' like most other editors and also since that is what it does.

    @marco
    Copy link
    Mannequin Author

    marco mannequin commented Dec 19, 2011

    Thank you Roger
    find_keep_open.patch works, but now that brings me to bpo-13630 that I thought was existing, and now this confirms it.

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jun 30, 2017
    @terryjreedy terryjreedy self-assigned this Jun 30, 2017
    @ZackerySpytz
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Dec 13, 2019

    I've created a pull request for this issue. Please take a look.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    serhiy-storchaka added a commit that referenced this issue Dec 27, 2023
    …alog (GH-17593)
    
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 27, 2023
    …ce" dialog (pythonGH-17593)
    
    (cherry picked from commit 712afab)
    
    Co-authored-by: Zackery Spytz <zspytz@gmail.com>
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 27, 2023
    …ce" dialog (pythonGH-17593)
    
    (cherry picked from commit 712afab)
    
    Co-authored-by: Zackery Spytz <zspytz@gmail.com>
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    @serhiy-storchaka serhiy-storchaka added 3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes and removed 3.7 (EOL) end of life labels Dec 27, 2023
    serhiy-storchaka added a commit that referenced this issue Dec 27, 2023
    …ace" dialog (GH-17593) (GH-113515)
    
    (cherry picked from commit 712afab)
    
    Co-authored-by: Zackery Spytz <zspytz@gmail.com>
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    serhiy-storchaka added a commit that referenced this issue Dec 27, 2023
    …ace" dialog (GH-17593) (GH-113514)
    
    (cherry picked from commit 712afab)
    
    Co-authored-by: Zackery Spytz <zspytz@gmail.com>
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    terryjreedy added a commit to terryjreedy/cpython that referenced this issue Dec 27, 2023
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 27, 2023
    (cherry picked from commit 6c98fce)
    
    Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 27, 2023
    (cherry picked from commit 6c98fce)
    
    Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
    terryjreedy added a commit that referenced this issue Dec 27, 2023
    gh-57795: Add news to idlelib/News3.txt (GH-113522)
    (cherry picked from commit 6c98fce)
    
    Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
    terryjreedy added a commit that referenced this issue Dec 27, 2023
    gh-57795: Add news to idlelib/News3.txt (GH-113522)
    (cherry picked from commit 6c98fce)
    
    Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
    kulikjak pushed a commit to kulikjak/cpython that referenced this issue Jan 22, 2024
    …ce" dialog (pythonGH-17593)
    
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    kulikjak pushed a commit to kulikjak/cpython that referenced this issue Jan 22, 2024
    aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
    …ce" dialog (pythonGH-17593)
    
    Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
    Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
    aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes 3.12 bugs and security fixes 3.13 new features, bugs and security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    Status: Done
    Development

    No branches or pull requests

    2 participants