diff options
| author | John Ehresman <unknown> | 2017-01-22 19:45:45 +1100 | 
|---|---|---|
| committer | John Ehresman <unknown> | 2017-01-22 19:45:45 +1100 | 
| commit | ed3a51fa704071682545f084e3ab52d86200519c (patch) | |
| tree | cafa810b6a7ecf33298064d94b177903bc2aeea5 /src | |
| parent | 013bf48bff4164a02137b2e790bbed8b32c4e98e (diff) | |
| download | scintilla-mirror-ed3a51fa704071682545f084e3ab52d86200519c.tar.gz | |
Display block caret over the character at the end of a selection to be similar
to other editors.
Diffstat (limited to 'src')
| -rw-r--r-- | src/EditView.cxx | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/EditView.cxx b/src/EditView.cxx index a35a46b54..48991e480 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1288,7 +1288,13 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt  	// For each selection draw  	for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) {  		const bool mainCaret = r == model.sel.Main(); -		const SelectionPosition posCaret = (drawDrag ? model.posDrag : model.sel.Range(r).caret); +		SelectionPosition posCaret = (drawDrag ? model.posDrag : model.sel.Range(r).caret); +		if (vsDraw.caretStyle == CARETSTYLE_BLOCK && !drawDrag && posCaret > model.sel.Range(r).anchor) { +			if (posCaret.VirtualSpace() > 0) +				posCaret.SetVirtualSpace(posCaret.VirtualSpace() - 1); +			else +				posCaret.SetPosition(model.pdoc->MovePositionOutsideChar(posCaret.Position()-1, -1)); +		}  		const int offset = posCaret.Position() - posLineStart;  		const XYPOSITION spaceWidth = vsDraw.styles[ll->EndLineStyle()].spaceWidth;  		const XYPOSITION virtualOffset = posCaret.VirtualSpace() * spaceWidth; | 
