KTextEditor
katetextblock.cpp
289 const bool lineChanged = (oldSizeOfPreviousLine > 0 && m_lines.at(line - 1)->markedAsModified())
290 || (sizeOfCurrentLine > 0 && (oldSizeOfPreviousLine > 0 || m_lines.at(line)->markedAsModified()));
399 // special handling if cursor behind the real line, e.g. non-wrapping cursor in block selection mode
405 // we only need to trigger checkValidity later if the range has feedback or might be invalidated
407 if (range && !range->isValidityCheckRequired() && (range->feedback() || range->start().line() == range->end().line())) {
436 removedText = textOfLine.mid(range.start().column(), range.end().column() - range.start().column());
474 // we only need to trigger checkValidity later if the range has feedback or might be invalidated
476 if (range && !range->isValidityCheckRequired() && (range->feedback() || range->start().line() == range->end().line())) {
493 printf("%4d - %4lld : %4d : '%s'\n", blockIndex, (unsigned long long)startLine() + i, m_lines.at(i)->text().size(), qPrintable(m_lines.at(i)->text()));
532 std::for_each(m_cachedLineForRanges.begin(), m_cachedLineForRanges.end(), [&allRanges](const std::pair<TextRange *, int> &pair) {
567 std::for_each(m_cachedLineForRanges.begin(), m_cachedLineForRanges.end(), [&allRanges](const std::pair<TextRange *, int> &pair) {
626 QVector<TextRange *> TextBlock::rangesForLine(int line, KTextEditor::View *view, bool rangesWithAttributeOnly) const
648 if (range->startInternal().lineInternal() <= line && line <= range->endInternal().lineInternal()) {
constexpr int column() const Q_DECL_NOEXCEPT
Retrieve the column on which this cursor is situated.
Definition: cursor.h:213
QSet< TextRange * > cachedRangesForLine(int line) const
Return all ranges in this block which might intersect the given line and only span one line.
Definition: katetextblock.h:238
int size() const const
void deleteBlockContent()
Delete the block content, delete all lines and delete all cursors not bound to ranges.
Definition: katetextblock.cpp:578
QVector< TextRange * > rangesForLine(int line, KTextEditor::View *view, bool rangesWithAttributeOnly) const
Return all ranges in this block which might intersect the given line.
Definition: katetextblock.cpp:626
const TextCursor & endInternal() const
Nonvirtual version of end(), which is faster.
Definition: katetextrange.h:143
An object representing a section of text, from one Cursor to another.
Definition: include/ktexteditor/range.h:44
void markModifiedLinesAsSaved()
Flag all modified text lines as saved on disk.
Definition: katetextblock.cpp:659
int lineInternal() const
Non-virtual version of line(), which is faster.
Definition: katetextcursor.h:124
constexpr Cursor end() const Q_DECL_NOEXCEPT
Get the end position of this range.
Definition: include/ktexteditor/range.h:181
void unwrapLine(int line, TextBlock *previousBlock, int fixStartLinesStartIndex)
Unwrap given line.
Definition: katetextblock.cpp:180
void removeText(KTextEditor::Range range, QString &removedText)
Remove text at given range.
Definition: katetextblock.cpp:420
constexpr LineRange toLineRange() const Q_DECL_NOEXCEPT
Convert this Range to a LineRange.
Definition: include/ktexteditor/range.h:191
void push_back(const T &t)
void wrapLine(const KTextEditor::Cursor position, int fixStartLinesStartIndex)
Wrap line at given cursor position.
Definition: katetextblock.cpp:73
TextBlock(TextBuffer *buffer, int startLine)
Construct an empty text block.
Definition: katetextblock.cpp:15
void reserve(int size)
QString & remove(int position, int n)
void insertText(const KTextEditor::Cursor position, const QString &text)
Insert text at given cursor position.
Definition: katetextblock.cpp:351
void clearBlockContent(TextBlock *targetBlock)
Clear the block content, delete all lines, move all cursors not bound to range to given block at 0,...
Definition: katetextblock.cpp:602
constexpr Cursor start() const Q_DECL_NOEXCEPT
Get the start position of this range.
Definition: include/ktexteditor/range.h:171
QString & insert(int position, QChar ch)
const TextCursor & startInternal() const
Non-virtual version of start(), which is faster.
Definition: katetextrange.h:125
void appendLine(const QString &textOfLine)
Append a new line with given text.
Definition: katetextblock.cpp:50
constexpr int line() const Q_DECL_NOEXCEPT
Retrieve the line on which this cursor is situated.
Definition: cursor.h:195
void mergeBlock(TextBlock *targetBlock)
Merge this block with given one, the given one must be a direct predecessor.
Definition: katetextblock.cpp:546
QString mid(int position, int n) const const
void debugPrint(int blockIndex) const
Debug output, print whole block content with line numbers and line length.
Definition: katetextblock.cpp:489
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:52:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:52:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.