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: Find(ed) text is not highlighted while dialog box is open
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Found text not always highlighted by Replace dialog on Windows
View: 18590
Assigned To: Nosy List: fgracia, marco, roger.serwy, taleinat, terry.reedy
Priority: normal Keywords:

Created on 2011-12-19 02:13 by marco, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (9)
msg149811 - (view) Author: Marco Scataglini (marco) Date: 2011-12-19 02:13
Found text does not show at all highlighted on some text colors (like green and orange) when using the find button in the replace dialog box when box is open/visible.

Then when dialog box is closed it will highlight the found text in black on gray like 'selected' and not in white on black 'found' highlighting color scheme.

Using F3, to find text, highlights in black on gray like 'selected' and not in white on black 'found' highlighting color scheme

Also using CTRL+f to find text seems to follow the same improper behavior, just less noticeable since as soon as find button is pressed, the dialog box is closed and the found text is shown, but if the dialog box would not close the text would not be shown with any highlighting at all ('found' nor 'selected' highlighting).

To test the last behavior I used the find_keep_open.patch to prevent CTRL+f Find Dialog box to close after pressing find button.(issue13586)

Color scheme highlighting setting can be seen in IDLE Preferences pane under the Highlighting tab by going to Options/Configure IDLE...
msg149881 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2011-12-19 17:43
IDLE does have a color scheme configuration for "found" as listed in the highlighting config dialog and internally as the Tkinter Text tag "hit". This looks like the stubs for functionality that never got implemented.

Take a look at the SearchBar IDLE extension. It provides incremental searching which highlights all matches.
msg149940 - (view) Author: Marco Scataglini (marco) Date: 2011-12-21 00:24
Well I checked 'SearchBar' IDLE extension and is not bad... has some minor bugs, nothing major just very very minor quirky behavior, but nothing that seems to impair functionality AFAIK.
It should be cleaned up and added to release in place of the existing non-functional one.
Just my 2c, of course.
msg214368 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-03-21 14:15
I"m considering updating SearchBar and posting a patch.

Marco, any chance you could detail the quirks and bugs you experienced when using SearchBar?
msg218101 - (view) Author: Francisco Gracia (fgracia) Date: 2014-05-08 09:37
I had problems for installing your *SearchBar*, Tal, in Python 33 and 34 until it downed onto me that in its present form it is only Python 2 compliant. This is then its first weakness, that of course can be easily remedied by applying ** to it, as I did. I am using Windows 7.

Another fault is that when IDLE's editor window is expanded to full screen the bar's widget fills half of it. I imagine that this should not be difficult to mend either.

If you would be interested in suggestions for your revision, mine would be that the option controls of the *Find* searchbar be disposed in two rows. This would avoid a certain clutter and allow the addition of a new one that, if possible, I would find convenient. It would perform the toggling of the simultaneous highlighting of all the matches of the search, something that is handy in some situations but can be confusing in others.

These are the only quirks that I have observed until now. I think that *SearchBar* is a must for anyone that uses IDLE's editor in 3.4 or in any previous version of Python (as I have discovered here that the problem is an old one) and am surprised that it does not belong to the standard distribution since it was available.

Thanks and congratulations for your excellent job.
msg218107 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-05-08 11:07
Thanks for the kind words, Francisco! And also for taking the time to get SearchBar working on Python3 and giving it a try.

I agree that SearchBar is a huge improvement over IDLE's simple find and replace dialogs. And by now every potential user is used to such search interfaces, whereas search dialogs are a thing of the past.

Regarding your suggestion to split the buttons into a separate line, that would make problems with the replace mode. In the replace mode there are two bars, the first of which is the regular search bar. By adding another bar for controls, that would mean having three bars, and it would be non-obvious to users whether the option refer to the find or replace bar.

Also, we must be careful not to add many options and controls to the interface, and this is the first time someone has asked to be able to toggle search hit highlighting. If this comes up repeatedly I will consider it.
msg218155 - (view) Author: Francisco Gracia (fgracia) Date: 2014-05-09 12:17
The neat program ** toggles between *Highlight first match* and *Highlight all matches*.
msg218160 - (view) Author: Tal Einat (taleinat) * (Python committer) Date: 2014-05-09 12:40
Indeed, does include this feature. But it is a completely different application with a very specific goal - testing regular expressions.

On the other hand, IDLE's search is meant to be used to find pieces of code in the editor, which is a significantly different use case.

Since SearchBar always sets the pointer to the first match, as well as highlighting it, there would no real point to only mark the first match.

As for disabling the marking of all other matches (besides the first), what is the point? Does marking all other hits really have any downsides? To me it seems like a useful feature that users will easily grow accustomed to.
msg219545 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-02 02:20
I currently have the same problem with Idle's builtin Search and Replace dialogs. In that respect, this is a duplicate of #18590. Since the discussion here shifted to a third party extension, I am closing this issue and leaving the other one open.
Date User Action Args
2022-04-11 14:57:24adminsetgithub: 57839
2014-06-02 02:20:48terry.reedysetstatus: open -> closed
superseder: Found text not always highlighted by Replace dialog on Windows
messages: + msg219545

resolution: duplicate
stage: resolved
2014-05-09 12:40:56taleinatsetmessages: + msg218160
2014-05-09 12:17:43fgraciasetmessages: + msg218155
2014-05-08 11:07:04taleinatsetmessages: + msg218107
2014-05-08 09:37:45fgraciasetmessages: + msg218101
2014-05-07 14:42:32berker.peksaglinkissue21450 superseder
2014-05-07 14:41:47berker.peksagsetnosy: + fgracia
2014-03-21 21:38:49terry.reedysetversions: + Python 3.5, - Python 3.3
2014-03-21 14:15:30taleinatsetnosy: + taleinat
messages: + msg214368
2013-06-15 18:49:00terry.reedysetversions: + Python 3.3, Python 3.4, - Python 3.2
2011-12-24 01:36:35terry.reedysetnosy: + terry.reedy
2011-12-21 00:24:21marcosetmessages: + msg149940
2011-12-19 17:43:59roger.serwysetnosy: + roger.serwy
messages: + msg149881
2011-12-19 02:13:49marcocreate