diff --git a/NEWS.md b/NEWS.md index 3ec7b242..16fe6dcc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,7 @@ Red Panda C++ Version 1.0.5 - enhancement: only show function tips when cursor is after ',' or '('. - enhancement: when auto complete function names, only append '(' if before identifier or "/' - update highconstrast icon set + - fix: index of the longest line not correctly updated when insert/delete multiple lines ( which will cause selection errors) Red Panda C++ Version 1.0.4 - fix: hide function tips, when move or resize the main window diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 759abd10..fb7f079e 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -3482,7 +3482,6 @@ void Editor::updateFunctionTip(bool showTip) if (currentLine>=document()->count()) return; QChar ch=lastNonSpaceChar(currentLine,currentChar); - qDebug()<=Index && (mIndexOfLongestLine =Index) { + if (mIndexOfLongestLine 0) + emit inserted(0,mLines.count()); endUpdate(); }); + mIndexOfLongestLine = -1; //test for utf8 / utf 8 bom if (encoding == ENCODING_AUTO_DETECT) { if (file.atEnd()) { @@ -636,7 +646,6 @@ void SynDocument::loadFromFile(const QString& filename, const QByteArray& encodi } line = file.readLine(); } - emit inserted(0,mLines.count()); if (!needReread) { if (allAscii) realEncoding = ENCODING_ASCII; @@ -646,7 +655,6 @@ void SynDocument::loadFromFile(const QString& filename, const QByteArray& encodi QList charsets = pCharsetInfoManager->findCharsetByLocale(pCharsetInfoManager->localeName()); if (!charsets.isEmpty()) { if (tryLoadFileByEncoding(realEncoding,file)) { - emit inserted(0,mLines.count()); return; } @@ -659,9 +667,8 @@ void SynDocument::loadFromFile(const QString& filename, const QByteArray& encodi if (encodingName == ENCODING_UTF8) continue; if (tryLoadFileByEncoding(encodingName,file)) { - qDebug()<