diff options
author | nyamatongwe <devnull@localhost> | 2001-06-11 12:27:07 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2001-06-11 12:27:07 +0000 |
commit | 7cbc0667020e39dd64cb34eb74be04306e67520e (patch) | |
tree | ad6cdd87a9b625beedf60a68a7c76b1685ba140c /src | |
parent | e531567c4037953cc7fd4a9f60b0a3cd85de1c70 (diff) | |
download | scintilla-mirror-7cbc0667020e39dd64cb34eb74be04306e67520e.tar.gz |
Patch from Michele to make tab and backspace in indentation work
better.
Diffstat (limited to 'src')
-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 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 { |