Skip to content

Commit

Permalink
Studio app module/track finder and column search: apply track finder …
Browse files Browse the repository at this point in the history
…text filtering to other track finder family commands.

Apply track finder text filtering to other track finder commands: column search, find next/previous tracks.
This will be backported to lTS20.
  • Loading branch information
josephsl committed Jan 20, 2021
1 parent 7594bdd commit 14551f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions addon/appModules/splstudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,10 @@ def script_findTrack(self, gesture):
description=_("Finds text in columns."))
def script_columnSearch(self, gesture):
if self._trackFinderCheck(1):
if self.findText is not None:
self.findText = list(filter(lambda x: x not in (None, ""), self.findText))
if not len(self.findText):
self.findText = None
self.trackFinderGUI(columnSearch=True)

# Find next and previous scripts.
Expand All @@ -1504,6 +1508,11 @@ def script_columnSearch(self, gesture):
gesture="kb:nvda+f3")
def script_findTrackNext(self, gesture):
if self._trackFinderCheck(0):
# Although counterintuitive, filtering must take place here as well to avoid finding nothing or everything.
# Passing in None or an empty string to track finder results in "finding" the next track.
self.findText = list(filter(lambda x: x not in (None, ""), self.findText))
if not len(self.findText):
self.findText = None
if self.findText is None:
self.trackFinderGUI()
else:
Expand All @@ -1518,6 +1527,10 @@ def script_findTrackNext(self, gesture):
gesture="kb:shift+nvda+f3")
def script_findTrackPrevious(self, gesture):
if self._trackFinderCheck(0):
# Same as find next: filter find text list here, too.
self.findText = list(filter(lambda x: x not in (None, ""), self.findText))
if not len(self.findText):
self.findText = None
if self.findText is None:
self.trackFinderGUI()
else:
Expand Down

0 comments on commit 14551f6

Please sign in to comment.