This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE: Add navigate bar and replace current goto dialog
Type: enhancement Stage:
Components: IDLE Versions: Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: louielu, terry.reedy
Priority: normal Keywords:

Created on 2017-05-31 08:02 by louielu, last changed 2022-04-11 14:58 by admin.

File name Uploaded Description Edit
Selection_0804.png louielu, 2017-06-06 06:58
Pull Requests
URL Status Linked Edit
PR 1884 open louielu, 2017-05-31 08:03
Messages (3)
msg294819 - (view) Author: Louie Lu (louielu) * Date: 2017-05-31 08:02
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.
msg295211 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-06-05 20:35
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.
msg295242 - (view) Author: Louie Lu (louielu) * Date: 2017-06-06 06:58
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.
Date User Action Args
2022-04-11 14:58:47adminsetgithub: 74706
2017-06-06 06:58:08louielusetfiles: + Selection_0804.png

messages: + msg295242
2017-06-05 20:35:40terry.reedysetmessages: + msg295211
2017-05-31 08:03:52louielusetpull_requests: + pull_request1960
2017-05-31 08:02:16louielucreate