Search for and highlight next occurrence of pattern in text. No text replacement is done with this option.
(self, ok=False)
| 176 | self.close() |
| 177 | |
| 178 | def do_find(self, ok=False): |
| 179 | """Search for and highlight next occurrence of pattern in text. |
| 180 | |
| 181 | No text replacement is done with this option. |
| 182 | """ |
| 183 | if not self.engine.getprog(): |
| 184 | return False |
| 185 | text = self.text |
| 186 | res = self.engine.search_text(text, None, ok) |
| 187 | if not res: |
| 188 | self.bell() |
| 189 | return False |
| 190 | line, m = res |
| 191 | i, j = m.span() |
| 192 | first = "%d.%d" % (line, i) |
| 193 | last = "%d.%d" % (line, j) |
| 194 | self.show_hit(first, last) |
| 195 | self.ok = True |
| 196 | return True |
| 197 | |
| 198 | def do_replace(self): |
| 199 | "Replace search pattern in text with replacement value." |
no test coverage detected