diff options
author | nyamatongwe <unknown> | 2000-10-13 12:10:36 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-10-13 12:10:36 +0000 |
commit | 52e1d779717f0d6543f4df2d2ec242eac3b43f97 (patch) | |
tree | 2b79475e74f57ab22e56d1933f7d690ca60b8e71 | |
parent | a5f53b5aea3245eeb736293c3e023d456f7b9944 (diff) | |
download | scintilla-mirror-52e1d779717f0d6543f4df2d2ec242eac3b43f97.tar.gz |
Fix from Peter to make tab key fill up to tab stop when using spaces.
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index c95985ec7..16049e20d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2299,10 +2299,14 @@ void Editor::Indent(bool forwards) { pdoc->InsertChar(currentPos, '\t'); SetEmptySelection(currentPos + 1); } else { - for (int i = 0; i < pdoc->tabInChars; i++) { + int numSpaces = (pdoc->tabInChars) - + (pdoc->GetColumn(currentPos) % (pdoc->tabInChars)); + if (numSpaces < 1) + numSpaces = pdoc->tabInChars; + for (int i = 0; i < numSpaces; i++) { pdoc->InsertChar(currentPos, ' '); } - SetEmptySelection(currentPos + pdoc->tabInChars); + SetEmptySelection(currentPos + numSpaces); } } else { int anchorPosOnLine = anchor - pdoc->LineStart(lineOfAnchor); |