Commits

Anonymous committed 1b2727f

fixed indenter warning

Comments (0)

Files changed (1)

chickenindenter.cpp

 
 bool ChickenIndenter::isElectricCharacter(const QChar &ch) const
 {
+    Q_UNUSED(ch);
     return false;
 }
 
 void ChickenIndenter::indentBlock(QTextDocument *doc, const QTextBlock &block, const QChar &typedChar,
                                   const TextEditor::TabSettings &tabSettings)
 {
+    Q_UNUSED(doc);
+    Q_UNUSED(typedChar);
     int indent = 0;
     int padding = 0;
     tabSettings.indentLine(block, indent + padding, padding);
 void ChickenIndenter::indent(QTextDocument *doc, const QTextCursor &cursor, const QChar &typedChar,
                              const TextEditor::TabSettings &tabSettings)
 {
+    Q_UNUSED(doc);
+    Q_UNUSED(typedChar);
+
     //qDebug() << "tab_size:" << tabSettings.m_tabSize << " indent_size:" << tabSettings.m_indentSize;
     if (cursor.hasSelection()) {
         //qDebug() << " selection: " << cursor.block().text();
         int lb = 0;
         int rb = 0;
         int indent = 0;
-        QTextBlock i = cursor.block().previous();
+        QTextBlock b = cursor.block().previous();
         QTextCursor tc = cursor;
         do {
-            const QString s = i.text();
+            const QString s = b.text();
             if (s.trimmed().isEmpty())
             {
                 //qDebug() << "empty line break indent search";
             if (rb > lb)
             {
                 //qDebug() << " search closing bracket on prev line";
-                i = i.previous();
+                b = b.previous();
                 continue;
             }
             else if (lb == rb)
                 indent += lb;
             }
             break;
-        } while (i.isValid());
+        } while (b.isValid());
         indent_block:
         tc.beginEditBlock();
         //remove traling spaces