Commit 0d5ce9ed authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Fix getIndentation case

parent a1874920
......@@ -203,7 +203,7 @@ const QString indentString(KTextEditor::Document *document)
return "\t";
}
QString getindentation( const QString &line ) {
QString getIndentation( const QString &line ) {
return line.left(line.indexOf(QRegExp("\\S"), 0));
}
......
......@@ -64,10 +64,10 @@ const QString KDEVPHPCOMPLETION_EXPORT indentString(KTextEditor::Document *docum
* You usually want to use it with something like the following:
*
* \code
* const QString indentation = getindentation( document->line(replaceRange.start().line()) );
* const QString indentation = getIndentation( document->line(replaceRange.start().line()) );
* \endcode
*/
QString KDEVPHPCOMPLETION_EXPORT getindentation( const QString &line );
QString KDEVPHPCOMPLETION_EXPORT getIndentation( const QString &line );
}
#endif
......
......@@ -121,7 +121,7 @@ void ImplementationItem::execute(KTextEditor::Document* document, const KTextEdi
QString indentation;
{
QString currentLine = document->line(replaceRange.start().line());
indentation = getindentation(currentLine);
indentation = getIndentation(currentLine);
if ( !currentLine.isEmpty() && currentLine != indentation ) {
// since theres some non-whitespace in this line, skip to the enxt one
......
......@@ -69,7 +69,7 @@ void KeywordItem::execute(KTextEditor::Document* document, const KTextEditor::Ra
{
if ( !m_replacement.isEmpty() ) {
QString replacement = m_replacement;
replacement = replacement.replace('\n', '\n' + getindentation(document->line(word.start().line())));
replacement = replacement.replace('\n', '\n' + getIndentation(document->line(word.start().line())));
replacement = replacement.replace("%INDENT%", indentString(document));
int cursorPos = replacement.indexOf("%CURSOR%");
......
......@@ -206,7 +206,7 @@ const QString indentString(KTextEditor::Document *document)
return QStringLiteral("\t");
}
QString getindentation( const QString &line ) {
QString getIndentation( const QString &line ) {
return line.left(line.indexOf(QRegExp("\\S"), 0));
}
......
......@@ -65,10 +65,10 @@ const QString KDEVPHPCOMPLETION_EXPORT indentString(KTextEditor::Document *docum
* You usually want to use it with something like the following:
*
* \code
* const QString indentation = getindentation( document->line(replaceRange.start().line()) );
* const QString indentation = getIndentation( document->line(replaceRange.start().line()) );
* \endcode
*/
QString KDEVPHPCOMPLETION_EXPORT getindentation( const QString &line );
QString KDEVPHPCOMPLETION_EXPORT getIndentation( const QString &line );
}
#endif
......
......@@ -124,7 +124,7 @@ void ImplementationItem::execute(KTextEditor::View* view, const KTextEditor::Ran
QString indentation;
{
QString currentLine = document->line(replaceRange.start().line());
indentation = getindentation(currentLine);
indentation = getIndentation(currentLine);
if ( !currentLine.isEmpty() && currentLine != indentation ) {
// since theres some non-whitespace in this line, skip to the enxt one
......
......@@ -71,7 +71,7 @@ void KeywordItem::execute(KTextEditor::View* view, const KTextEditor::Range& wor
KTextEditor::Document *document = view->document();
if ( !m_replacement.isEmpty() ) {
QString replacement = m_replacement;
replacement = replacement.replace('\n', '\n' + getindentation(document->line(word.start().line())));
replacement = replacement.replace('\n', '\n' + getIndentation(document->line(word.start().line())));
replacement = replacement.replace(QLatin1String("%INDENT%"), indentString(document));
int cursorPos = replacement.indexOf(QStringLiteral("%CURSOR%"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment