Skip to content

Commit

Permalink
Bugfix: Don't always paste on top in texteditor
Browse files Browse the repository at this point in the history
This was caused by switching always to HTML and thus
repositioning the cursor
  • Loading branch information
insilmaril committed Oct 24, 2017
1 parent 256c384 commit 08e8257
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion texteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ bool TextEditor::eventFilter( QObject *obj, QEvent *ev)
if (obj == e ) {
if (ev->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(ev);
if(keyEvent == QKeySequence::Paste)
if(keyEvent == QKeySequence::Paste)
{
// switch editor mode to match clipboard content before pasting
const QClipboard *clipboard = QApplication::clipboard();
Expand Down Expand Up @@ -932,6 +932,9 @@ void TextEditor::toggleFonthint()

void TextEditor::setRichTextMode(bool b)
{
// Avoid changes which would reposition cursor before pasting
if (b == actionFormatRichText->isChecked() ) return;

if (b)
{
e->setHtml (e->toHtml());
Expand Down

0 comments on commit 08e8257

Please sign in to comment.