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 current goto dialog #74706

Open
mlouielu mannequin opened this issue May 31, 2017 · 4 comments
Open

IDLE: Replace current goto dialog #74706

mlouielu mannequin opened this issue May 31, 2017 · 4 comments
Assignees
Labels
3.7 (EOL) end of life topic-IDLE type-feature A feature request or enhancement

Comments

@mlouielu
Copy link
Mannequin

mlouielu mannequin commented May 31, 2017

BPO 30521
Nosy @terryjreedy, @mlouielu
PRs
  • gh-74706: IDLE: Add navigate bar and replace current goto dialog #1884
  • Files
  • Selection_0804.png
  • 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 2017-05-31.08:02:16.542>
    labels = ['expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Add navigate bar and replace current goto dialog'
    updated_at = <Date 2017-06-06.06:58:08.746>
    user = 'https://github.com/mlouielu'

    bugs.python.org fields:

    activity = <Date 2017-06-06.06:58:08.746>
    actor = 'louielu'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2017-05-31.08:02:16.542>
    creator = 'louielu'
    dependencies = []
    files = ['46925']
    hgrepos = []
    issue_num = 30521
    keywords = []
    message_count = 3.0
    messages = ['294819', '295211', '295242']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'louielu']
    pr_nums = ['1884']
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30521'
    versions = ['Python 3.7']

    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented May 31, 2017

    Propose a sublime-like navigate bar to replace current goto dialog.

    Navigate bar current support two different mode: prefix ':' for goto line, and prefix '@' for goto symbol.

    When user use shortcut Ctrl+G to open goto line, it will prompt out a navigate bar on the top of the editor.text with prefix ':', user can enter valid lineno, and it will highlight the line on the editor.

    After return, it will close the navigate bar and clear the highlight, user cursor will be set to the target lineno.

    @mlouielu mlouielu mannequin added the 3.7 (EOL) end of life label May 31, 2017
    @mlouielu mlouielu mannequin assigned terryjreedy May 31, 2017
    @mlouielu mlouielu mannequin added topic-IDLE type-feature A feature request or enhancement labels May 31, 2017
    @terryjreedy
    Copy link
    Member

    What problem are you trying to solve with this idea and patch? A popup go to line box is standard enough for editors that beginners have no problem with it.

    That asked, I read the sublime-text doc on the go-anywhere bar. While it is a cute idea, I think that trying to mix multiple functions like this is mis-conceived. Mixing control signals (the prefixes) with content is *always* a problem. Suppose one wanted to search for the string ': 10'? The problems people have with \ in string literals and various control chars in regexes also illustrate the point.

    Once a user hits alt-g (not cntl-g, which IDLE uses from find-again), IDLE knows to expect a string of digits that can be fed to int(). Replacing the clear 'go to line number:' prompt with the anti-mnemonic ':', mixed in with the input, is to me a regression.

    Here is an alternate idea for streamlining line number entry. In the status bar, replace the labels that display line and column with entry boxes. Alt-G sends the cursor to the line# entry. The color is changed to indicate entry mode. Escape undoes any change and sends the cursor back where it was. Click send the cursor to the click spot. Return goes to the (new) line and send the cursor there. Tab moves the cursor to the column box for possible column entry. A click on either box switches it to entry mode.

    While goto column is much less needed, I can think of use cases and notice that the goto box for Notepad2 on Win10 includes a separate column entry box.

    I think someone else proposed adding a simple find box with default options to the status bar. This would *not* replace the current box. For simple searches, it would solve the problem of the box initially obscuring text, now that it no longer disappears when Next is clicked.

    @mlouielu
    Copy link
    Mannequin Author

    mlouielu mannequin commented Jun 6, 2017

    I agree with what you says that the prefix of ":" and "@" may confuse beginners when using "goto line" function.

    I survey some editor, that visual studio and sublime use this kind of navigate bar, but visual studio will show up "go to line xx" when user type the integer into it.

    Komodo editor and Android Studio will prompt up a dialog inside the window (not a separate window dialog) and let user enter the line number.

    notepadqq (notepad++ on Linux), leafpad, Code::Blocks, and IDLE will prompt out a seperate dialog for goto function.

    -----

    If we change to use a Label to display that the navigate bar's function is "Go to line", and close the navigate bar when user focusOut the bar, will it be more proper for the beginner user?

    -----

    For proposing this patch, one main reason is that Tkinter didn't support not-separate dialog, I'm ok with a dialog or navigate bar (whatever else is ok), if the single-window app is in the roadmap, then we still will need to face that these dialog (search, goto ..etc) need another way to solve it.

    If we still want the form of a dialog, then Android Studio's dialog may be what we want for IDLE, it is not separate from main-UI, and it is a traditional dialog. (screenshot attached)

    p.s. In unix, the setting of goto-line is control+g, windows is alt+g, both of our shortcut are right.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @terryjreedy terryjreedy changed the title IDLE: Add navigate bar and replace current goto dialog IDLE: Replace current goto dialog Jul 1, 2022
    @terryjreedy
    Copy link
    Member

    Leaving open for my alternate idea for a change above: "In the status bar, replace the labels that display line and column with entry boxes. Alt-G sends the cursor to the line# entry. The color is changed to indicate entry mode. Escape undoes any change and sends the cursor back where it was. Click send the cursor to the click spot. Return goes to the (new) line and send the cursor there. Tab moves the cursor to the column box for possible column entry. A click on either box switches it to entry mode."

    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 topic-IDLE type-feature A feature request or enhancement
    Projects
    Status: In Progress
    Development

    No branches or pull requests

    1 participant