KTextEditor
katehighlight.cpp
80 properties.emptyLines.push_back(QRegularExpression(emptyLine, QRegularExpression::UseUnicodePropertiesOption));
111void KateHighlighting::doHighlight(const Kate::TextLine *prevLine, Kate::TextLine *textLine, bool &ctxChanged, Foldings *foldings)
141 // a bit ugly: we set the line to highlight as member to be able to update its stats in the applyFormat and applyFolding member functions
144 const KSyntaxHighlighting::State initialState(!prevLine ? KSyntaxHighlighting::State() : prevLine->highlightingState());
145 const KSyntaxHighlighting::State endOfLineState = highlightLine(textLine->text(), initialState);
167void KateHighlighting::applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format)
183void KateHighlighting::applyFolding(int offset, int length, KSyntaxHighlighting::FoldingRegion region)
188 // WE ATM assume ascending offset order, we add the length to the offset for the folding ends to have ranges spanning the full folding region
190 m_foldings->emplace_back(offset + ((region.type() == KSyntaxHighlighting::FoldingRegion::Begin) ? 0 : length), length, region);
251 return m_propertiesForFormat.at(sanitizeFormatIndex(attrib))->definition.name() + QLatin1Char(':')
257 return !m_propertiesForFormat.at(sanitizeFormatIndex(attrib))->definition.isWordDelimiter(c) && !c.isSpace() && c != QLatin1Char('"')
263 return m_propertiesForFormat.at(sanitizeFormatIndex(attrib))->definition.isWordWrapDelimiter(c) && c != QLatin1Char('"') && c != QLatin1Char('\'');
276 && ((!startProperties->multiLineCommentStart.isEmpty() && !startProperties->multiLineCommentEnd.isEmpty())
295KSyntaxHighlighting::CommentPosition KateHighlighting::getCommentSingleLinePosition(int attrib) const
311QList<KTextEditor::Attribute::Ptr> KateHighlighting::attributesForDefinition(const QString &schema) const
319 KTextEditor::Attribute::Ptr newAttribute(new KTextEditor::Attribute(nameForAttrib(array.size()), format.textStyle()));
393 const QRegularExpressionMatch match = re.match(txt, 0, QRegularExpression::NormalMatch, QRegularExpression::AnchorAtOffsetMatchOption);
402int KateHighlighting::attributeForLocation(KTextEditor::DocumentPrivate *doc, const KTextEditor::Cursor cursor)
423QStringList KateHighlighting::keywordsForLocation(KTextEditor::DocumentPrivate *doc, const KTextEditor::Cursor cursor)
436bool KateHighlighting::spellCheckingRequiredForLocation(KTextEditor::DocumentPrivate *doc, const KTextEditor::Cursor cursor)
441QString KateHighlighting::higlightingModeForLocation(KTextEditor::DocumentPrivate *doc, const KTextEditor::Cursor cursor)
virtual void setDefinition(const Definition &def)
Definition definition() const
State highlightLine(QStringView text, const State &state)
QString style() const
QStringList keywordList(const QString &name) const
bool isValid() const
QString filePath() const
bool isHidden() const
bool indentationBasedFoldingEnabled() const
bool foldingEnabled() const
QString translatedSection() const
QList< Format > formats() const
QString name() const
QStringList keywordLists() const
QString indenter() const
QList< Definition > includedDefinitions() const
int id() const
bool isValid() const
Type type() const
bool isUnderline(const Theme &theme) const
QString name() const
QColor textColor(const Theme &theme) const
QColor selectedBackgroundColor(const Theme &theme) const
bool isValid() const
Theme::TextStyle textStyle() const
bool spellCheck() const
bool isBold(const Theme &theme) const
QColor backgroundColor(const Theme &theme) const
QColor selectedTextColor(const Theme &theme) const
int id() const
bool isItalic(const Theme &theme) const
bool isStrikeThrough(const Theme &theme) const
Q_INVOKABLE KSyntaxHighlighting::Theme theme(const QString &themeName) const
QExplicitlySharedDataPointer< Attribute > Ptr
Shared data pointer for Attribute.
Definition attribute.h:56
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition cursor.h:192
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition cursor.h:174
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
Kate::TextLine kateTextLine(int i)
Same as plainKateTextLine(), except that it is made sure the line is highlighted.
Definition katedocument.cpp:5795
This class can be used to efficiently search for occurrences of strings in a given string.
Definition prefixstore.h:27
int attribute(int pos) const
Gets the attribute at the given position use KRenderer::attributes to get the KTextAttribute for this...
Definition katetextline.cpp:181
const QString & text() const
Accessor to the text contained in this line.
Definition katetextline.h:89
void setHighlightingState(const KSyntaxHighlighting::State &val)
Sets the syntax highlight context number.
Definition katetextline.h:310
void clearMarkedAsFoldingStartAndEnd()
Clear folding start and end status.
Definition katetextline.h:179
const KSyntaxHighlighting::State & highlightingState() const
context stack
Definition katetextline.h:301
void markAsFoldingStartAttribute()
Mark as folding start line of an attribute based folding.
Definition katetextline.h:197
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
KGuiItem properties()
const QList< QKeySequence > & end()
CommentPosition
bool isSpace(char32_t ucs4)
QColor fromRgba(QRgb rgba)
QRgb rgba() const const
void clear()
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
void reserve(qsizetype size)
qsizetype size() const const
AnchorAtOffsetMatchOption
NormalMatch
UseUnicodePropertiesOption
const QChar at(qsizetype position) const const
bool isEmpty() const const
qsizetype length() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.