Skip to content

Commit

Permalink
correct errors not being highlighted when program loaded
Browse files Browse the repository at this point in the history
when the text of the edit box is set when a program is loaded, the
cursor becomes invalid, so any errors set during the set do not get
displayed

the setPlainText() function was reimplemented in the edit box so the
cursor valid flag can be set to false until after the text is set when
the cursor is valid again (is moved once the document is set)
  • Loading branch information
thunder422 committed May 11, 2013
1 parent 65893e5 commit 58b0f23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions editbox.cpp
Expand Up @@ -364,6 +364,16 @@ void EditBox::cursorMoved(void)
}


// overloaded function to set plain text of the document

void EditBox::setPlainText(const QString &text)
{
// invalidate cursor until text is set
m_cursorValid = false;
QPlainTextEdit::setPlainText(text);
}


// function to check if current line was modified and to process it

void EditBox::captureModifiedLine(int offset)
Expand Down
1 change: 1 addition & 0 deletions editbox.h
Expand Up @@ -64,6 +64,7 @@ public slots:
void documentChanged(int position, int charsRemoved, int charsAdded);
void cursorMoved(void);
void updateErrors(const ErrorList &errors);
void setPlainText(const QString &text);

private slots:
void lineNumberWidgetUpdateWidth(void);
Expand Down

0 comments on commit 58b0f23

Please sign in to comment.