void KateAutoIndent::checkRequiredStyle() { if (m_script) { if (!isStyleProvided(m_script, doc->highlight())) { kDebug( 13060 ) << "mode" << m_mode << "requires a different highlight style"; doc->config()->setIndentationMode(MODE_NORMAL); } } }
void KateAutoIndent::checkRequiredStyle() { if (m_script) { if (!isStyleProvided(m_script, doc->highlight())) { kDebug( 13060 ) << "mode" << m_mode << "requires a different highlight style: document style '" << doc->highlightingMode() << "'" ", but script require '" << m_script->indentHeader().requiredStyle() << "'" ; doc->config()->setIndentationMode(MODE_NORMAL); } } }
void KateAutoIndent::setMode (const QString &name) { // bail out, already set correct mode... if (m_mode == name) return; // cleanup m_script = 0; // first, catch easy stuff... normal mode and none, easy... if ( name.isEmpty() || name == MODE_NONE ) { m_mode = MODE_NONE; return; } if ( name == MODE_NORMAL ) { m_mode = MODE_NORMAL; return; } // handle script indenters, if any for this name... KateIndentScript *script = KateGlobal::self()->scriptManager()->indentationScript(name); if ( script ) { if (isStyleProvided(script, doc->highlight())) { m_script = script; m_mode = name; kDebug( 13060 ) << "mode: " << name << "accepted"; return; } else { kWarning( 13060 ) << "mode" << name << "requires a different highlight style: document style '" << doc->highlightingMode() << "'" ", but script require '" << script->indentHeader().requiredStyle() << "'" ; } } else { kWarning( 13060 ) << "mode" << name << "does not exist"; } // Fall back to normal m_mode = MODE_NORMAL; }