@@ -473,7 +473,6 @@ def __init__(self, parent):
473
473
self ._searchOptions .setToolTip (
474
474
"Enter one or multiple space-separated search expressions.\n "
475
475
"A variable name will be displayed if it matches at least one of the expressions.\n "
476
- "Press RETURN while typing to immediately update the search results.\n "
477
476
"\n "
478
477
"Depending on the settings, search expressions are either\n "
479
478
"\n "
@@ -517,7 +516,7 @@ def __init__(self, parent):
517
516
self ._options ._menu .triggered .connect (self ._onOptionMenuTiggered )
518
517
self ._searchOptions .pressed .connect (self ._onSearchOptionsPress )
519
518
self ._searchOptions ._menu .triggered .connect (self ._onSearchOptionMenuTiggered )
520
- self ._searchText .editingFinished .connect (self ._onSearchTextUpdated )
519
+ self ._searchText .textChanged .connect (self ._onSearchTextUpdated )
521
520
self ._btnAddAllToViewer .pressed .connect (self ._tree ._addAllToViewer )
522
521
523
522
def displayEmptyWorkspace (self , empty , customMessage = None ):
@@ -584,6 +583,7 @@ def _onSearchOptionsPress(self):
584
583
searchOptions = [
585
584
("searchMatchCase" , True , pyzo .translate ("pyzoWorkspace" , "Match case" )),
586
585
("searchRegExp" , False , pyzo .translate ("pyzoWorkspace" , "RegExp" )),
586
+ ("searchStartsWith" , True , pyzo .translate ("pyzoWorkspace" , "Starts with ..." )),
587
587
]
588
588
589
589
for name , default , label in searchOptions :
@@ -607,8 +607,12 @@ def _onSearchTextUpdated(self):
607
607
if len (needles ) == 0 :
608
608
regExpList = [r".*" ]
609
609
elif self ._config .searchRegExp :
610
+ if self ._config .searchStartsWith :
611
+ needles = [s + ".*" for s in needles ]
610
612
regExpList = needles
611
613
else :
614
+ if self ._config .searchStartsWith :
615
+ needles = [s + "*" for s in needles ]
612
616
regExpList = [wildcardsToRegExp (s ) for s in needles ]
613
617
614
618
pattern = "(?:" + ")|(?:" .join (regExpList ) + ")"
0 commit comments