aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index f3aac824f..f70826473 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2226,9 +2226,15 @@ void Editor::Indent(bool forwards) {
int lineCurrentPos = pdoc->LineFromPosition(currentPos);
if (lineOfAnchor == lineCurrentPos) {
ClearSelection();
- pdoc->InsertChar(currentPos, '\t');
- //pdoc->InsertChar(currentPos++, '\t');
- SetEmptySelection(currentPos + 1);
+ if (pdoc->useTabs) {
+ pdoc->InsertChar(currentPos, '\t');
+ SetEmptySelection(currentPos + 1);
+ } else {
+ for (int i=0; i<pdoc->tabInChars; i++){
+ pdoc->InsertChar(currentPos, ' ');
+ }
+ SetEmptySelection(currentPos + pdoc->tabInChars);
+ }
} else {
int anchorPosOnLine = anchor - pdoc->LineStart(lineOfAnchor);
int currentPosPosOnLine = currentPos - pdoc->LineStart(lineCurrentPos);