Skip to content

Commit 7b043d6

Browse files
implement prompt trimming if config says to
--HG-- branch : scroll-frontend extra : rebase_source : 192560d8f287e00f8628cd50d7c7a41cc54e07f1
1 parent 4c5746c commit 7b043d6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bpython/scrollfrontend/repl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
INFOBOX_ONLY_BELOW = True
3333

3434
#TODO implement paste mode and figure out what the deal with config.paste_time is
35-
#TODO check config.auto_display_list
35+
#TODO figure out how config.auto_display_list=False behaves and implement it
3636
#TODO figure out how config.list_win_visible behaves and implement it
37-
#TODO config.cli_trim_prompts
3837
#TODO implement config.syntax
3938
#TODO other autocomplete modes even though I hate them
4039
#TODO config.colors_scheme['error']
@@ -289,6 +288,9 @@ def add_normal_character(self, char):
289288
char +
290289
self._current_line[self.cursor_offset_in_line:])
291290
self.cursor_offset_in_line += 1
291+
if self.config.cli_trim_prompts and self._current_line.startswith(">>> "):
292+
self._current_line = self._current_line[4:]
293+
self.cursor_offset_in_line = max(0, self.cursor_offset_in_line - 4)
292294
self.cursor_offset_in_line, self._current_line = substitute_abbreviations(self.cursor_offset_in_line, self._current_line)
293295
#TODO deal with characters that take up more than one space? do we care?
294296

0 commit comments

Comments
 (0)