lineOffset = command.offset - lineInfo.getOffset();
} catch (BadLocationException e) {
Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
}
ILineTracker lineTracker = getLineTracker(document, originalText);
int startIndex = 0;
int index = newText.indexOf(TAB_CHARACTER);
while (index != -1) {
String indent = getIndentString(indentationWidth, lineOffset, lineTracker, index);
// replace \t character with spaces
newText.replace(index, index + 1, indent);
if (lineTracker != null) {
try {
lineTracker.replace(index, 1, indent);
} catch (BadLocationException e) {
// if something goes wrong with replacing text, just
// reset to current string
lineTracker.set(newText.toString());
Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
}
}
startIndex = index + indent.length();