(self, text, prog, line, col, wrap, ok=0)
| 140 | return res |
| 141 | |
| 142 | def search_forward(self, text, prog, line, col, wrap, ok=0): |
| 143 | wrapped = 0 |
| 144 | startline = line |
| 145 | chars = text.get("%d.0" % line, "%d.0" % (line+1)) |
| 146 | while chars: |
| 147 | m = prog.search(chars[:-1], col) |
| 148 | if m: |
| 149 | if ok or m.end() > col: |
| 150 | return line, m |
| 151 | line = line + 1 |
| 152 | if wrapped and line > startline: |
| 153 | break |
| 154 | col = 0 |
| 155 | ok = 1 |
| 156 | chars = text.get("%d.0" % line, "%d.0" % (line+1)) |
| 157 | if not chars and wrap: |
| 158 | wrapped = 1 |
| 159 | wrap = 0 |
| 160 | line = 1 |
| 161 | chars = text.get("1.0", "2.0") |
| 162 | return None |
| 163 | |
| 164 | def search_backward(self, text, prog, line, col, wrap, ok=0): |
| 165 | wrapped = 0 |
no test coverage detected