fix: update longest line width

This commit is contained in:
Roy Qu 2024-03-30 11:11:34 +08:00
parent d76ef859c5
commit d31221ff42
1 changed files with 3 additions and 1 deletions

View File

@ -1212,6 +1212,8 @@ void Document::updateLongestLineWidth(int line, int width)
{ {
if (mIndexOfLongestLine<0) { if (mIndexOfLongestLine<0) {
setIndexOfLongestLine(line); setIndexOfLongestLine(line);
} else if (mIndexOfLongestLine == line) {
emitMaxLineWidthChanged();
} else if (mLines[mIndexOfLongestLine]->mWidth < width) { } else if (mLines[mIndexOfLongestLine]->mWidth < width) {
setIndexOfLongestLine(line); setIndexOfLongestLine(line);
} }