URI: 
       tfix history in console - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit a25f57035401fff1bb87ce417477a8f52d2e9be6
   DIR parent 56588de5d92f8128b8eea7605b16b787cddc9a7b
  HTML Author: ecdsa <ecdsa@github>
       Date:   Mon,  4 Mar 2013 17:18:48 +0100
       
       fix history in console
       
       Diffstat:
         M gui/qt_console.py                   |      12 ++++++++----
       
       1 file changed, 8 insertions(+), 4 deletions(-)
       ---
   DIR diff --git a/gui/qt_console.py b/gui/qt_console.py
       t@@ -69,10 +69,13 @@ class Console(QtGui.QPlainTextEdit):
            def setCommand(self, command):
                if self.getCommand() == command:
                    return
       +
       +        doc = self.document()
       +        curr_line = unicode(doc.findBlockByLineNumber(doc.lineCount() - 1).text())
                self.moveCursor(QtGui.QTextCursor.End)
       -        self.moveCursor(QtGui.QTextCursor.StartOfLine, QtGui.QTextCursor.KeepAnchor)
       -        for i in range(len(self.prompt)):
       -            self.moveCursor(QtGui.QTextCursor.Right, QtGui.QTextCursor.KeepAnchor)
       +        for i in range(len(curr_line) - len(self.prompt)):
       +            self.moveCursor(QtGui.QTextCursor.Left, QtGui.QTextCursor.KeepAnchor)
       +
                self.textCursor().removeSelectedText()
                self.textCursor().insertText(command)
                self.moveCursor(QtGui.QTextCursor.End)
       t@@ -151,7 +154,8 @@ class Console(QtGui.QPlainTextEdit):
                return ''
        
            def getCursorPosition(self):
       -        return self.textCursor().columnNumber() - len(self.prompt)
       +        c = self.textCursor()
       +        return c.position() - c.block().position() - len(self.prompt)
        
            def setCursorPosition(self, position):
                self.moveCursor(QtGui.QTextCursor.StartOfLine)