From a3ed291e1aafb4e48d60a04fad97e504cec6b13d Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 31 Oct 2013 16:35:06 +0400 Subject: [PATCH] assertion --- .../editorActions/moveUpDown/MoverWrapper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java index e9e5b2d0d494..34e3ddddb066 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -178,12 +178,12 @@ class MoverWrapper { int line1 = editor.offsetToLogicalPosition(range.getStartOffset()).line; int line2 = editor.offsetToLogicalPosition(range.getEndOffset()).line; - while (!lineContainsNonSpaces(document, line1) && line1 <= line2) line1++; - while (!lineContainsNonSpaces(document, line2) && line2 > line1) line2--; + while (!lineContainsNonSpaces(document, line1) && line1 < line2) line1++; + while (!lineContainsNonSpaces(document, line2) && line1 < line2) line2--; - final FileViewProvider provider = file.getViewProvider(); - PsiFile rootToAdjustIndentIn = provider.getPsi(provider.getBaseLanguage()); - codeStyleManager.adjustLineIndent(rootToAdjustIndentIn, new TextRange(document.getLineStartOffset(line1), document.getLineStartOffset(line2))); + final FileViewProvider provider = file.getViewProvider(); + PsiFile rootToAdjustIndentIn = provider.getPsi(provider.getBaseLanguage()); + codeStyleManager.adjustLineIndent(rootToAdjustIndentIn, new TextRange(document.getLineStartOffset(line1), document.getLineStartOffset(line2))); } private static boolean lineContainsNonSpaces(final Document document, final int line) {