Skip to content

Commit 452f04a

Browse files
committed
Improve multiline cursor behavior in Python console and expression editor
Now supports multi-line inserts and pastes (cherry picked from commit dab069e)
1 parent 7116450 commit 452f04a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

python/console/console_editor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def __init__(self, parent=None):
146146
self.setEdgeMode(QsciScintilla.EdgeLine)
147147
self.setEdgeColumn(80)
148148

149+
self.SendScintilla(self.SCI_SETADDITIONALSELECTIONTYPING, 1)
150+
self.SendScintilla(self.SCI_SETMULTIPASTE, 1)
151+
149152
# self.setWrapMode(QsciScintilla.WrapCharacter)
150153
self.setWhitespaceVisibility(QsciScintilla.WsVisibleAfterIndent)
151154
# self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)

src/gui/qgscodeeditor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ QgsCodeEditor::QgsCodeEditor( QWidget *parent, const QString &title, bool foldin
3838
}
3939
setSciWidget();
4040
setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
41+
42+
SendScintilla( SCI_SETADDITIONALSELECTIONTYPING, 1 );
43+
SendScintilla( SCI_SETMULTIPASTE, 1 );
4144
}
4245

4346
// Workaround a bug in QScintilla 2.8.X

0 commit comments

Comments
 (0)