Skip to content

Commit

Permalink
Improve multiline cursor behavior in Python console and expression ed…
Browse files Browse the repository at this point in the history
…itor

Now supports multi-line inserts and pastes
  • Loading branch information
nyalldawson committed Dec 20, 2018
1 parent e9e1e0d commit dab069e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/console/console_editor.py
Expand Up @@ -146,6 +146,9 @@ def __init__(self, parent=None):
self.setEdgeMode(QsciScintilla.EdgeLine)
self.setEdgeColumn(80)

self.SendScintilla(self.SCI_SETADDITIONALSELECTIONTYPING, 1)
self.SendScintilla(self.SCI_SETMULTIPASTE, 1)

# self.setWrapMode(QsciScintilla.WrapCharacter)
self.setWhitespaceVisibility(QsciScintilla.WsVisibleAfterIndent)
# self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgscodeeditor.cpp
Expand Up @@ -38,6 +38,9 @@ QgsCodeEditor::QgsCodeEditor( QWidget *parent, const QString &title, bool foldin
}
setSciWidget();
setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );

SendScintilla( SCI_SETADDITIONALSELECTIONTYPING, 1 );
SendScintilla( SCI_SETMULTIPASTE, 1 );
}

// Workaround a bug in QScintilla 2.8.X
Expand Down

0 comments on commit dab069e

Please sign in to comment.