Skip to content

Commit

Permalink
Work on isearch; add to README
Browse files Browse the repository at this point in the history
  • Loading branch information
bgribble committed Feb 26, 2025
1 parent a1866da commit 0124e21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ preview. These are all in the `master` branch.
any connections. A message like `@show "Layer 1"` will send the
`@show` method call, which will change the patch's display to
the named layer.
* **Interactive search.** The `/` key starts an interactive search which
highlights matching text. C-RET to cycle the selection between
matching items, or C-A-RET to select all matching.

### BUILDING

Expand Down
4 changes: 2 additions & 2 deletions mfp/gui/app_window_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ async def select_all(self):

@extends(AppWindow)
async def unselect_all(self):
oldsel = self.selected
self.selected = []
oldsel = [*self.selected]
for obj in oldsel:
obj.end_control()
await self.unselect(obj)
self.selected = []
return True


Expand Down
5 changes: 3 additions & 2 deletions mfp/gui/modes/global_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def init_bindings(cls):
cls.bind(
"search-interactive-select-next", cls.search_interactive_next,
helptext="Select next element matching search string",
keysym="S-RET",
keysym="C-RET",
)
cls.bind(
"search-interactive-select-prev", cls.search_interactive_prev,
Expand All @@ -79,7 +79,7 @@ def init_bindings(cls):
cls.bind(
"search-interactive-select-all", cls.search_interactive_all,
helptext="Select all elements matching search string",
keysym="A-RET"
keysym="C-A-RET"
)
cls.bind(
"toggle-console", cls.toggle_console, helptext="Show/hide log and console",
Expand Down Expand Up @@ -794,6 +794,7 @@ async def search_interactive_next(self, forward=True):
)

async def search_interactive_prev(self):
await self.window.unselect_all()
self.search_interactive_next(forward=False)

async def search_interactive_all(self):
Expand Down

0 comments on commit 0124e21

Please sign in to comment.