Program: 192
Project: 192
Buggy source:
public void indentRange(@NotNull Editor editor,@NotNull DataContext context,@NotNull TextRange range,int count,int dir){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + count);
  }
  Project proj=PlatformDataKeys.PROJECT.getData(context);
  int tabSize=8;
  int indentSize=8;
  boolean useTabs=true;
  VirtualFile file=EditorData.getVirtualFile(editor);
  if (file != null) {
    FileType type=FileTypeManager.getInstance().getFileTypeByFile(file);
    CodeStyleSettings settings=CodeStyleSettingsManager.getSettings(proj);
    tabSize=settings.getTabSize(type);
    indentSize=settings.getIndentSize(type);
    useTabs=settings.useTabCharacter(type);
  }
  int sline=editor.offsetToLogicalPosition(range.getStartOffset()).line;
  int eline=editor.offsetToLogicalPosition(range.getEndOffset()).line;
  int eoff=EditorHelper.getLineStartForOffset(editor,range.getEndOffset());
  boolean elineIsEmpty=EditorHelper.getLineLength(editor,eline) == 0;
  if (eoff == range.getEndOffset() && elineIsEmpty) {
    eline--;
  }
  if (range.isMultiple()) {
    int col=editor.offsetToLogicalPosition(range.getStartOffset()).column;
    int size=indentSize * count;
    if (dir == 1) {
      StringBuilder space=new StringBuilder();
      int tabCnt=0;
      int spcCnt;
      if (useTabs) {
        tabCnt=size / tabSize;
        spcCnt=size % tabSize;
      }
 else {
        spcCnt=size;
      }
      for (int i=0; i < tabCnt; i++) {
        space.append('\t');
      }
      for (int i=0; i < spcCnt; i++) {
        space.append(' ');
      }
      for (int l=sline; l <= eline; l++) {
        int len=EditorHelper.getLineLength(editor,l);
        if (len > col) {
          LogicalPosition spos=new LogicalPosition(l,col);
          insertText(editor,editor.logicalPositionToOffset(spos),space.toString());
        }
      }
    }
 else {
      CharSequence chars=editor.getDocument().getCharsSequence();
      for (int l=sline; l <= eline; l++) {
        int len=EditorHelper.getLineLength(editor,l);
        if (len > col) {
          LogicalPosition spos=new LogicalPosition(l,col);
          LogicalPosition epos=new LogicalPosition(l,col + size - 1);
          int wsoff=editor.logicalPositionToOffset(spos);
          int weoff=editor.logicalPositionToOffset(epos);
          int pos;
          for (pos=wsoff; pos <= weoff; pos++) {
            if (CharacterHelper.charType(chars.charAt(pos),false) != CharacterHelper.CharacterType.WHITESPACE) {
              break;
            }
          }
          if (pos > wsoff) {
            deleteText(editor,new TextRange(wsoff,pos),null);
          }
        }
      }
    }
  }
 else {
    for (int l=sline; l <= eline; l++) {
      int soff=EditorHelper.getLineStartOffset(editor,l);
      int woff=VimPlugin.getMotion().moveCaretToLineStartSkipLeading(editor,l);
      int col=editor.offsetToVisualPosition(woff).column;
      int newCol=Math.max(0,col + dir * indentSize * count);
      if (dir == 1 || col > 0) {
        StringBuilder space=new StringBuilder();
        int tabCnt=0;
        int spcCnt;
        if (useTabs) {
          tabCnt=newCol / tabSize;
          spcCnt=newCol % tabSize;
        }
 else {
          spcCnt=newCol;
        }
        for (int i=0; i < tabCnt; i++) {
          space.append('\t');
        }
        for (int i=0; i < spcCnt; i++) {
          space.append(' ');
        }
        replaceText(editor,soff,woff,space.toString());
      }
    }
  }
  if (!CommandState.inInsertMode(editor)) {
    if (!range.isMultiple()) {
      MotionGroup.moveCaret(editor,VimPlugin.getMotion().moveCaretToLineStartSkipLeading(editor,sline));
    }
 else {
      MotionGroup.moveCaret(editor,range.getStartOffset());
    }
  }
  EditorData.setLastColumn(editor,editor.getCaretModel().getVisualPosition().column);
}

Fixed version (ground truth):
public void indentRange(@NotNull Editor editor,@NotNull DataContext context,@NotNull TextRange range,int count,int dir){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + count);
  }
  Project proj=PlatformDataKeys.PROJECT.getData(context);
  int tabSize=8;
  int indentSize=8;
  boolean useTabs=true;
  VirtualFile file=EditorData.getVirtualFile(editor);
  if (file != null) {
    FileType type=FileTypeManager.getInstance().getFileTypeByFile(file);
    CodeStyleSettings settings=CodeStyleSettingsManager.getSettings(proj);
    tabSize=settings.getTabSize(type);
    indentSize=settings.getIndentSize(type);
    useTabs=settings.useTabCharacter(type);
  }
  int sline=editor.offsetToLogicalPosition(range.getStartOffset()).line;
  int eline=editor.offsetToLogicalPosition(range.getEndOffset()).line;
  if (range.isMultiple()) {
    int col=editor.offsetToLogicalPosition(range.getStartOffset()).column;
    int size=indentSize * count;
    if (dir == 1) {
      StringBuilder space=new StringBuilder();
      int tabCnt=0;
      int spcCnt;
      if (useTabs) {
        tabCnt=size / tabSize;
        spcCnt=size % tabSize;
      }
 else {
        spcCnt=size;
      }
      for (int i=0; i < tabCnt; i++) {
        space.append('\t');
      }
      for (int i=0; i < spcCnt; i++) {
        space.append(' ');
      }
      for (int l=sline; l <= eline; l++) {
        int len=EditorHelper.getLineLength(editor,l);
        if (len > col) {
          LogicalPosition spos=new LogicalPosition(l,col);
          insertText(editor,editor.logicalPositionToOffset(spos),space.toString());
        }
      }
    }
 else {
      CharSequence chars=editor.getDocument().getCharsSequence();
      for (int l=sline; l <= eline; l++) {
        int len=EditorHelper.getLineLength(editor,l);
        if (len > col) {
          LogicalPosition spos=new LogicalPosition(l,col);
          LogicalPosition epos=new LogicalPosition(l,col + size - 1);
          int wsoff=editor.logicalPositionToOffset(spos);
          int weoff=editor.logicalPositionToOffset(epos);
          int pos;
          for (pos=wsoff; pos <= weoff; pos++) {
            if (CharacterHelper.charType(chars.charAt(pos),false) != CharacterHelper.CharacterType.WHITESPACE) {
              break;
            }
          }
          if (pos > wsoff) {
            deleteText(editor,new TextRange(wsoff,pos),null);
          }
        }
      }
    }
  }
 else {
    for (int l=sline; l <= eline; l++) {
      int soff=EditorHelper.getLineStartOffset(editor,l);
      int eoff=EditorHelper.getLineEndOffset(editor,l,true);
      int woff=VimPlugin.getMotion().moveCaretToLineStartSkipLeading(editor,l);
      int col=editor.offsetToVisualPosition(woff).column;
      int newCol=Math.max(0,col + dir * indentSize * count);
      if (col > 0 || soff != eoff) {
        StringBuilder space=new StringBuilder();
        int tabCnt=0;
        int spcCnt;
        if (useTabs) {
          tabCnt=newCol / tabSize;
          spcCnt=newCol % tabSize;
        }
 else {
          spcCnt=newCol;
        }
        for (int i=0; i < tabCnt; i++) {
          space.append('\t');
        }
        for (int i=0; i < spcCnt; i++) {
          space.append(' ');
        }
        replaceText(editor,soff,woff,space.toString());
      }
    }
  }
  if (!CommandState.inInsertMode(editor)) {
    if (!range.isMultiple()) {
      MotionGroup.moveCaret(editor,VimPlugin.getMotion().moveCaretToLineStartSkipLeading(editor,sline));
    }
 else {
      MotionGroup.moveCaret(editor,range.getStartOffset());
    }
  }
  EditorData.setLastColumn(editor,editor.getCaretModel().getVisualPosition().column);
}