Changeset View
Changeset View
Standalone View
Standalone View
src/document/katebuffer.cpp
Show First 20 Lines • Show All 448 Lines • ▼ Show 20 Line(s) | |||||
449 | #endif | 449 | #endif | ||
450 | } | 450 | } | ||
451 | 451 | | |||
452 | KTextEditor::Range KateBuffer::computeFoldingRangeForStartLine(int startLine) | 452 | KTextEditor::Range KateBuffer::computeFoldingRangeForStartLine(int startLine) | ||
453 | { | 453 | { | ||
454 | /** | 454 | /** | ||
455 | * ensure valid input | 455 | * ensure valid input | ||
456 | */ | 456 | */ | ||
457 | Q_ASSERT(startLine >= 0); | 457 | if (startLine < 0 || startLine >= lines()) { | ||
458 | Q_ASSERT(startLine < lines()); | 458 | return KTextEditor::Range::invalid(); | ||
459 | } | ||||
459 | 460 | | |||
460 | /** | 461 | /** | ||
461 | * no highlighting, no folding, ATM | 462 | * no highlighting, no folding, ATM | ||
462 | */ | 463 | */ | ||
463 | if (!m_highlight || m_highlight->noHighlighting()) { | 464 | if (!m_highlight || m_highlight->noHighlighting()) { | ||
464 | return KTextEditor::Range::invalid(); | 465 | return KTextEditor::Range::invalid(); | ||
465 | } | 466 | } | ||
466 | 467 | | |||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |