Return tuple of 'line.col' indexes from selection or insert mark.
(text)
| 210 | return found |
| 211 | |
| 212 | def get_selection(text): |
| 213 | '''Return tuple of 'line.col' indexes from selection or insert mark. |
| 214 | ''' |
| 215 | try: |
| 216 | first = text.index("sel.first") |
| 217 | last = text.index("sel.last") |
| 218 | except TclError: |
| 219 | first = last = None |
| 220 | if not first: |
| 221 | first = text.index("insert") |
| 222 | if not last: |
| 223 | last = first |
| 224 | return first, last |
| 225 | |
| 226 | def get_line_col(index): |
| 227 | '''Return (line, col) tuple of ints from 'line.col' string.''' |
no test coverage detected
searching dependent graphs…