aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-05-23 17:13:07 +1000
committernyamatongwe <devnull@localhost>2013-05-23 17:13:07 +1000
commit22a74a07936115dae5c307e92b18a90521432c4c (patch)
tree92ff55a41fdc4531918c1bf9bc32a6439cb2713e
parent413444468f55e977a7b60a928c53e66cfe305460 (diff)
downloadscintilla-mirror-22a74a07936115dae5c307e92b18a90521432c4c.tar.gz
Bug: [#1478]. Tab/backTab in column select requires one undo per line.
From Eric Promislow at ActiveState.
-rw-r--r--src/Editor.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 59e2678ab..65348f588 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5767,13 +5767,13 @@ int Editor::KeyDown(int key, bool shift, bool ctrl, bool alt, bool *consumed) {
}
void Editor::Indent(bool forwards) {
+ UndoGroup ug(pdoc);
for (size_t r=0; r<sel.Count(); r++) {
int lineOfAnchor = pdoc->LineFromPosition(sel.Range(r).anchor.Position());
int caretPosition = sel.Range(r).caret.Position();
int lineCurrentPos = pdoc->LineFromPosition(caretPosition);
if (lineOfAnchor == lineCurrentPos) {
if (forwards) {
- UndoGroup ug(pdoc);
pdoc->DeleteChars(sel.Range(r).Start().Position(), sel.Range(r).Length());
caretPosition = sel.Range(r).caret.Position();
if (pdoc->GetColumn(caretPosition) <= pdoc->GetColumn(pdoc->GetLineIndentPosition(lineCurrentPos)) &&
@@ -5800,7 +5800,6 @@ void Editor::Indent(bool forwards) {
} else {
if (pdoc->GetColumn(caretPosition) <= pdoc->GetLineIndentation(lineCurrentPos) &&
pdoc->tabIndents) {
- UndoGroup ug(pdoc);
int indentation = pdoc->GetLineIndentation(lineCurrentPos);
int indentationStep = pdoc->IndentSize();
pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep);
@@ -5824,10 +5823,7 @@ void Editor::Indent(bool forwards) {
int lineBottomSel = Platform::Maximum(lineOfAnchor, lineCurrentPos);
if (pdoc->LineStart(lineBottomSel) == sel.Range(r).anchor.Position() || pdoc->LineStart(lineBottomSel) == caretPosition)
lineBottomSel--; // If not selecting any characters on a line, do not indent
- {
- UndoGroup ug(pdoc);
- pdoc->Indent(forwards, lineBottomSel, lineTopSel);
- }
+ pdoc->Indent(forwards, lineBottomSel, lineTopSel);
if (lineOfAnchor < lineCurrentPos) {
if (currentPosPosOnLine == 0)
sel.Range(r) = SelectionRange(pdoc->LineStart(lineCurrentPos), pdoc->LineStart(lineOfAnchor));