(self, reverse=False, include_current=False)
| 891 | ) |
| 892 | |
| 893 | def incremental_search(self, reverse=False, include_current=False): |
| 894 | if self.incr_search_mode == SearchMode.NO_SEARCH: |
| 895 | self.rl_history.enter(self.current_line) |
| 896 | self.incr_search_target = "" |
| 897 | else: |
| 898 | if self.incr_search_target: |
| 899 | line = ( |
| 900 | self.rl_history.back( |
| 901 | False, |
| 902 | search=True, |
| 903 | target=self.incr_search_target, |
| 904 | include_current=include_current, |
| 905 | ) |
| 906 | if reverse |
| 907 | else self.rl_history.forward( |
| 908 | False, |
| 909 | search=True, |
| 910 | target=self.incr_search_target, |
| 911 | include_current=include_current, |
| 912 | ) |
| 913 | ) |
| 914 | self._set_current_line( |
| 915 | line, reset_rl_history=False, clear_special_mode=False |
| 916 | ) |
| 917 | self._set_cursor_offset( |
| 918 | len(self.current_line), |
| 919 | reset_rl_history=False, |
| 920 | clear_special_mode=False, |
| 921 | ) |
| 922 | if reverse: |
| 923 | self.incr_search_mode = SearchMode.REVERSE_INCREMENTAL_SEARCH |
| 924 | else: |
| 925 | self.incr_search_mode = SearchMode.INCREMENTAL_SEARCH |
| 926 | |
| 927 | def readline_kill(self, e): |
| 928 | func = self.edit_keys[e] |
no test coverage detected