mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 01:52:31 +02:00
...
This commit is contained in:
parent
c5e26ad9d5
commit
950f592b87
1 changed files with 6 additions and 0 deletions
|
|
@ -268,6 +268,11 @@ def fset(self, val):
|
|||
|
||||
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 @@ def enter_pressed(self):
|
|||
|
||||
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…
Reference in a new issue