diff options
author | nyamatongwe <unknown> | 2009-07-04 00:24:17 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2009-07-04 00:24:17 +0000 |
commit | 8ba8f85b7e0b8b3621c244cd711cdbefe0822e6e (patch) | |
tree | 658ef03619767f6704db3bb4489b7cfbd008439e /src | |
parent | 9c54599cc939df92c94843ca39c09d1c2ac0648b (diff) | |
download | scintilla-mirror-8ba8f85b7e0b8b3621c244cd711cdbefe0822e6e.tar.gz |
Made backspace work better for multi-selection.
Check virtual space options when mouse clicked in virtual space.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 0958d8076..fd2c04447 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3919,31 +3919,13 @@ void Editor::DelCharBack(bool allowLineStartDeletion) { sel.ClearVirtualSpace(r); } } - /* - if (!RangeContainsProtected(sel.MainCaret() - 1, sel.MainCaret())) { - int lineCurrentPos = pdoc->LineFromPosition(sel.MainCaret()); - if (allowLineStartDeletion || (pdoc->LineStart(lineCurrentPos) != sel.MainCaret())) { - if (pdoc->GetColumn(sel.MainCaret()) <= pdoc->GetLineIndentation(lineCurrentPos) && - pdoc->GetColumn(sel.MainCaret()) > 0 && pdoc->backspaceUnindents) { - pdoc->BeginUndoAction(); - int indentation = pdoc->GetLineIndentation(lineCurrentPos); - int indentationStep = pdoc->IndentSize(); - if (indentation % indentationStep == 0) { - pdoc->SetLineIndentation(lineCurrentPos, indentation - indentationStep); - } else { - pdoc->SetLineIndentation(lineCurrentPos, indentation - (indentation % indentationStep)); - } - SetEmptySelection(pdoc->GetLineIndentPosition(lineCurrentPos)); - pdoc->EndUndoAction(); - } else { - pdoc->DelCharBack(sel.MainCaret()); - } - } - } - */ } else { ClearSelection(); - SetEmptySelection(sel.MainCaret()); + if (sel.IsRectangular()) { + sel.selType = Selection::selThin; + sel.Rectangular() = SelectionRange(sel.Rectangular().caret, sel.Range(0).anchor); + } + //SetEmptySelection(sel.MainCaret()); } if (undoBracketNeeded) pdoc->EndUndoAction(); @@ -5527,7 +5509,7 @@ void Editor::DwellEnd(bool mouseMoved) { void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) { //Platform::DebugPrintf("ButtonDown %d %d = %d alt=%d %d\n", curTime, lastClickTime, curTime - lastClickTime, alt, inDragDrop); ptMouseLast = pt; - SelectionPosition newPos = SPositionFromLocation(pt); + SelectionPosition newPos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position()); inDragDrop = ddNone; sel.SetMoveExtends(false); @@ -5700,7 +5682,7 @@ void Editor::ButtonMove(Point pt) { DwellEnd(true); } - SelectionPosition movePos = SPositionFromLocation(pt); + SelectionPosition movePos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); movePos = MovePositionOutsideChar(movePos, sel.MainCaret() - movePos.Position()); if (inDragDrop == ddInitial) { @@ -5805,7 +5787,7 @@ void Editor::ButtonMove(Point pt) { void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { //Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop); - SelectionPosition newPos = SPositionFromLocation(pt); + SelectionPosition newPos = SPositionFromLocation(pt, false, false, (virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0); newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position()); if (inDragDrop == ddInitial) { inDragDrop = ddNone; |