Accepts character which is a part of CHARACTER_PAIR_MAP like brackets and quotes, and checks whether it should be inserted to the line or overwritten e.x. if you type ")" (rparen) , and your cursor is directly above another ")" (rparen) in the cmd, this will just ski
(self, e)
| 860 | self._cursor_offset -= 1 |
| 861 | |
| 862 | def insert_char_pair_end(self, e): |
| 863 | """Accepts character which is a part of CHARACTER_PAIR_MAP |
| 864 | like brackets and quotes, and checks whether it should be |
| 865 | inserted to the line or overwritten |
| 866 | |
| 867 | e.x. if you type ")" (rparen) , and your cursor is directly |
| 868 | above another ")" (rparen) in the cmd, this will just skip |
| 869 | it and move the cursor. |
| 870 | If there is no same character underneath the cursor, the |
| 871 | character will be printed/appended to the line |
| 872 | """ |
| 873 | if self.config.brackets_completion: |
| 874 | if self.cursor_offset < len(self._current_line): |
| 875 | if self._current_line[self.cursor_offset] == e: |
| 876 | self.cursor_offset += 1 |
| 877 | return |
| 878 | self.add_normal_character(e) |
| 879 | |
| 880 | def get_last_word(self): |
| 881 | previous_word = _last_word(self.rl_history.entry) |
no test coverage detected