aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-06-11 12:27:07 +0000
committernyamatongwe <unknown>2001-06-11 12:27:07 +0000
commit3cdce44ddeb99d0eaa5426c867cc4efbc1b48638 (patch)
treead6cdd87a9b625beedf60a68a7c76b1685ba140c /src/Editor.cxx
parent1e8012568f397f9f59c729eed2d8a1ccee966519 (diff)
downloadscintilla-mirror-3cdce44ddeb99d0eaa5426c867cc4efbc1b48638.tar.gz
Patch from Michele to make tab and backspace in indentation work
better.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 52de15714..235d09261 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1754,11 +1754,15 @@ void Editor::DelCharBack() {
if (currentPos == anchor) {
int lineCurrentPos = pdoc->LineFromPosition(currentPos);
if (pdoc->GetColumn(currentPos) <= pdoc->GetLineIndentation(lineCurrentPos) &&
- pdoc->GetColumn(currentPos) > 0 && pdoc->backspaceUnindents) {
+ pdoc->GetColumn(currentPos) > 0 && pdoc->backspaceUnindents) {
pdoc->BeginUndoAction();
int indentation = pdoc->GetLineIndentation(lineCurrentPos);
int indentationStep = (pdoc->indentInChars ? pdoc->indentInChars : pdoc->tabInChars);
- pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
+ if (indentation % indentationStep == 0) {
+ pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
+ } else {
+ pdoc->SetLineIndentation(lineCurrentPos, indentation - (indentation % indentationStep));
+ }
SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos));
pdoc->EndUndoAction();
} else {