Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateview.cpp
Show First 20 Lines • Show All 1306 Lines • ▼ Show 20 Line(s) | 1303 | if (!actionDone) { | |||
---|---|---|---|---|---|
1307 | } | 1307 | } | ||
1308 | } | 1308 | } | ||
1309 | 1309 | | |||
1310 | if (!actionDone) { | 1310 | if (!actionDone) { | ||
1311 | // Fold all in range, but not the range itself | 1311 | // Fold all in range, but not the range itself | ||
1312 | for (int ln = foldingRange.start().line() + 1; ln < foldingRange.end().line(); ++ln) { | 1312 | for (int ln = foldingRange.start().line() + 1; ln < foldingRange.end().line(); ++ln) { | ||
1313 | KTextEditor::Range fr = foldLine(ln); | 1313 | KTextEditor::Range fr = foldLine(ln); | ||
1314 | if (fr.isValid()) { | 1314 | if (fr.isValid()) { | ||
1315 | ln = fr.end().line() - 1; | 1315 | // qMax to avoid infinite loop in case of range without content | ||
1316 | ln = qMax(ln, fr.end().line() - 1); | ||||
1316 | actionDone = true; | 1317 | actionDone = true; | ||
1317 | } | 1318 | } | ||
1318 | } | 1319 | } | ||
1319 | } | 1320 | } | ||
1320 | 1321 | | |||
1321 | if (!actionDone) { | 1322 | if (!actionDone) { | ||
1322 | // At this point was an unfolded range clicked which contains no "childs" | 1323 | // At this point was an unfolded range clicked which contains no "childs" | ||
1323 | // We assume the user want to fold it by the wrong button, be obliging! | 1324 | // We assume the user want to fold it by the wrong button, be obliging! | ||
▲ Show 20 Lines • Show All 2597 Lines • Show Last 20 Lines |