Skip to content

Commit a2d2a95

Browse files
committed
Place line_start mark before moving the cursor in gtk_.ReplWidget.prompt().
This fixes the strange highlighting issue on startup.
1 parent 221659d commit a2d2a95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpython/gtk_.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,9 @@ def prompt(self, more):
561561
else:
562562
text = '>>> '
563563
with self.editing:
564-
self.text_buffer.insert_with_tags_by_name(self.get_cursor_iter(),
565-
text, 'prompt')
566-
iter_ = self.move_cursor(len(text))
564+
iter_ = self.get_cursor_iter()
565+
self.text_buffer.insert_with_tags_by_name(iter_, text, 'prompt')
566+
iter_.forward_chars(4)
567567
mark = self.text_buffer.create_mark('line_start', iter_, True)
568568
self.text_buffer.place_cursor(iter_)
569569
self.scroll_to_mark(mark, 0.2)

0 commit comments

Comments
 (0)