MCPcopy Create free account
hub / github.com/TabViewer/tabview / search

Method search

tabview/tabview.py:365–384  ·  view source on GitHub ↗

Open search window, get input and set the search string.

(self)

Source from the content-addressed store, hash-verified

363 return ch
364
365 def search(self):
366 """Open search window, get input and set the search string."""
367 scr2 = curses.newwin(3, self.max_x, self.max_y - 3, 0)
368 scr3 = scr2.derwin(1, self.max_x - 12, 1, 9)
369 scr2.box()
370 scr2.move(1, 1)
371 addstr(scr2, "Search: ")
372 scr2.refresh()
373 curses.curs_set(1)
374 self._search_win_open = 3
375 self.textpad = Textbox(scr3, insert_mode=True)
376 self.search_str = self.textpad.edit(self._search_validator)
377 self.search_str = self.search_str.lower().strip()
378 try:
379 curses.curs_set(0)
380 except _curses.error:
381 pass
382 if self.search_str:
383 self.init_search = None
384 self._search_win_open = 0
385
386 def search_results(self, rev=False, look_in_cur=False):
387 """Given self.search_str or self.init_search, find next result after

Callers

nothing calls this directly

Calls 1

addstrFunction · 0.85

Tested by

no test coverage detected