--- a/QScintilla/MiniEditor.py Fri May 24 18:39:58 2013 +0200 +++ b/QScintilla/MiniEditor.py Tue May 28 20:52:12 2013 +0200 @@ -171,6 +171,7 @@ self.__textEdit.textChanged.connect(self.__documentWasModified) self.__textEdit.modificationChanged.connect(self.__modificationChanged) self.__textEdit.cursorPositionChanged.connect(self.__cursorPositionChanged) + self.__textEdit.linesChanged.connect(self.__resizeLinenoMargin) self.__textEdit.setContextMenuPolicy(Qt.CustomContextMenu) self.__textEdit.customContextMenuRequested.connect(self.__contextMenuRequested) @@ -2094,8 +2095,7 @@ linenoMargin = Preferences.getEditor("LinenoMargin") self.__textEdit.setMarginLineNumbers(0, linenoMargin) if linenoMargin: - self.__textEdit.setMarginWidth(0, - ' ' + '8' * Preferences.getEditor("LinenoWidth")) + self.__resizeLinenoMargin() else: self.__textEdit.setMarginWidth(0, 16) @@ -2120,6 +2120,15 @@ else: self.__textEdit.setFolding(QsciScintilla.NoFoldStyle) + def __resizeLinenoMargin(self): + """ + Private slot to resize the line numbers margin. + """ + linenoMargin = Preferences.getEditor("LinenoMargin") + if linenoMargin: + self.__textEdit.setMarginWidth( + 0, '8' * (len(str(self.__textEdit.lines())) + 1)) + def __setTextDisplay(self): """ Private method to configure the text display. @@ -2206,6 +2215,9 @@ if Preferences.getEditor("OverrideEditAreaColours"): self.__textEdit.setColor(Preferences.getEditorColour("EditAreaForeground")) self.__textEdit.setPaper(Preferences.getEditorColour("EditAreaBackground")) + + self.__textEdit.setVirtualSpaceOptions( + Preferences.getEditor("VirtualSpaceOptions")) def __setEolMode(self): """