Returns a new line by substituting a common sequence in, and update matches
(self)
| 284 | ) |
| 285 | |
| 286 | def substitute_cseq(self) -> tuple[int, str]: |
| 287 | """Returns a new line by substituting a common sequence in, and update |
| 288 | matches""" |
| 289 | assert self.completer is not None |
| 290 | |
| 291 | cseq = os.path.commonprefix(self.matches) |
| 292 | new_cursor_offset, new_line = self.substitute(cseq) |
| 293 | if len(self.matches) == 1: |
| 294 | self.clear() |
| 295 | else: |
| 296 | self.update( |
| 297 | new_cursor_offset, new_line, self.matches, self.completer |
| 298 | ) |
| 299 | if len(self.matches) == 1: |
| 300 | self.clear() |
| 301 | return new_cursor_offset, new_line |
| 302 | |
| 303 | def update( |
| 304 | self, |