Skip to content

Commit c57fed1

Browse files
committed
fix potential stuck in macro mode
1 parent 5a72f2f commit c57fed1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/qcodeedit/lib/qeditor.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5401,15 +5401,18 @@ void QEditor::write(const QString& s)
54015401
{
54025402
document()->clearLanguageMatches();
54035403

5404-
if (!m_mirrors.empty())
5404+
bool macroing=false;
5405+
if (!m_mirrors.empty()){
54055406
m_doc->beginMacro();
5407+
macroing=true;
5408+
}
54065409

54075410
insertText(m_cursor, s);
54085411

54095412
for ( int i = 0; i < m_mirrors.count(); ++i )
54105413
insertText(m_mirrors[i], s);
54115414

5412-
if (!m_mirrors.empty())
5415+
if (macroing)
54135416
m_doc->endMacro();
54145417

54155418
emitCursorPositionChanged();

0 commit comments

Comments
 (0)