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

(cherry picked from commit dab069e)
  • Loading branch information
nyalldawson committed Dec 20, 2018
1 parent 7116450 commit 452f04a
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 452f04a

Please sign in to comment.