mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
c5e26ad9d5
commit
950f592b87
@ -268,6 +268,11 @@ class Console(QTextEdit):
|
||||
|
||||
return property(fget=fget, fset=fset, doc=doc)
|
||||
|
||||
def move_cursor_to_prompt(self):
|
||||
if self.prompt_frame is not None and self.cursor_pos[0] < 0:
|
||||
c = self.prompt_frame.lastCursorPosition()
|
||||
self.setTextCursor(c)
|
||||
|
||||
def prompt(self, strip_prompt_strings=True):
|
||||
if not self.prompt_frame:
|
||||
yield u'' if strip_prompt_strings else self.formatter.prompt
|
||||
@ -453,6 +458,7 @@ class Console(QTextEdit):
|
||||
|
||||
def text_typed(self, text):
|
||||
if self.prompt_frame is not None:
|
||||
self.move_cursor_to_prompt()
|
||||
self.cursor.insertText(text)
|
||||
self.render_current_prompt(restore_cursor=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user