Skip to content
Snippets Groups Projects
Commit 6fb4d2dfa8e4 authored by Jordi Gutiérrez Hermoso's avatar Jordi Gutiérrez Hermoso
Browse files

crecord: add a handlesearch function

This function sets up some of the UI, such as getting the search
string from the user and displaying results or their absence.
parent 880740426a34
No related branches found
No related tags found
1 merge request!776crecord: add search functionality (issue6834)
......@@ -1889,6 +1889,30 @@
return False
return True
def handlesearch(self):
win = curses.newwin(1, self.xscreensize, self.yscreensize - 1, 0)
win.echochar("/")
curses.echo()
curses.curs_set(1)
self.regex = win.getstr() or None
curses.noecho()
curses.curs_set(0)
if not self.showsearch(self.regex):
self.printstring(
win,
_(b"Pattern not found (press ENTER)"),
pairname=b"legend",
align=False,
)
while win.getkey() not in ["\n", "KEY_ENTER"]:
pass
del win
self.stdscr.clear()
self.stdscr.refresh()
def showsearch(self, regex, forward=True):
if not regex:
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment