aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-19 22:56:52 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-19 22:56:52 (GMT)
commit79cba8b7ccdb9ec6b89ca7907014256eb1641a70 (patch)
tree5c4959fac3451e62fe104b52dfa66d93ec0dc956
parent01a8dd4edd9d38cb56a0422fa352b297500f4890 (diff)
use default scheme, no need for view
-rw-r--r--src/script/katescriptdocument.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/script/katescriptdocument.cpp b/src/script/katescriptdocument.cpp
index 73419d0..74085b8 100644
--- a/src/script/katescriptdocument.cpp
+++ b/src/script/katescriptdocument.cpp
@@ -190,8 +190,9 @@ KTextEditor::Cursor KateScriptDocument::rfind(int line, int column, const QStrin
{
QScopedPointer<KTextEditor::MovingCursor> cursor(document()->newMovingCursor(KTextEditor::Cursor(line, column)));
const int start = cursor->line();
- QList<KTextEditor::Attribute::Ptr> attributes =
- m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
+
+ // just use the global default schema, we anyway only want the style number!
+ QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(KateRendererConfig::global()->schema());
do {
Kate::TextLine textLine = m_document->plainKateTextLine(cursor->line());
@@ -232,8 +233,9 @@ KTextEditor::Cursor KateScriptDocument::rfind(const KTextEditor::Cursor &cursor,
KTextEditor::Cursor KateScriptDocument::anchor(int line, int column, QChar character)
{
- QList<KTextEditor::Attribute::Ptr> attributes =
- m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
+ // just use the global default schema, we anyway only want the style number!
+ QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(KateRendererConfig::global()->schema());
+
int count = 1;
QChar lc;
QChar rc;
@@ -690,7 +692,8 @@ bool KateScriptDocument::isAttribute(const KTextEditor::Cursor &cursor, int attr
QString KateScriptDocument::attributeName(int line, int column)
{
- QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(static_cast<KTextEditor::ViewPrivate *>(m_document->activeView())->renderer()->config()->schema());
+ // just use the global default schema, we anyway only want the style number!
+ QList<KTextEditor::Attribute::Ptr> attributes = m_document->highlight()->attributes(KateRendererConfig::global()->schema());
KTextEditor::Attribute::Ptr a = attributes[document()->plainKateTextLine(line)->attribute(column)];
return a->property(KateExtendedAttribute::AttributeName).toString();
}