diff options
author | Zufu Liu <unknown> | 2019-02-02 10:26:58 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-02-02 10:26:58 +1100 |
commit | 9cc096e3f7deb6f10512e30da3e589eed927fdd5 (patch) | |
tree | 2430275cd7bece15c853a71af9fb64267d4476a0 /src | |
parent | 3b23e66a4f754a935f308a5c41a2f08f2968d5c3 (diff) | |
download | scintilla-mirror-9cc096e3f7deb6f10512e30da3e589eed927fdd5.tar.gz |
Backport: Feature [feature-requests:#1217]. Implement CARETSTYLE_BLOCK_ALWAYS.
Backport of changeset 7248:aba09a1c7c63.
Diffstat (limited to 'src')
-rw-r--r-- | src/EditView.cxx | 6 | ||||
-rw-r--r-- | src/EditView.h | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index 3143134d2..8eaaee32c 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -1331,7 +1331,7 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) { const bool mainCaret = r == model.sel.Main(); SelectionPosition posCaret = (drawDrag ? model.posDrag : model.sel.Range(r).caret); - if (vsDraw.caretStyle == CARETSTYLE_BLOCK && !drawDrag && posCaret > model.sel.Range(r).anchor) { + if ((vsDraw.caretStyle == CARETSTYLE_BLOCK || vsDraw.caretStyle == CARETSTYLE_BLOCK_ALWAYS) && !drawDrag && posCaret > model.sel.Range(r).anchor) { if (posCaret.VirtualSpace() > 0) posCaret.SetVirtualSpace(posCaret.VirtualSpace() - 1); else @@ -1378,12 +1378,12 @@ void EditView::DrawCarets(Surface *surface, const EditModel &model, const ViewSt /* Dragging text, use a line caret */ rcCaret.left = round(xposCaret - caretWidthOffset); rcCaret.right = rcCaret.left + vsDraw.caretWidth; - } else if (model.inOverstrike && drawOverstrikeCaret) { + } else if ((model.inOverstrike && vsDraw.caretStyle != CARETSTYLE_BLOCK_ALWAYS) && drawOverstrikeCaret) { /* Overstrike (insert mode), use a modified bar caret */ rcCaret.top = rcCaret.bottom - 2; rcCaret.left = xposCaret + 1; rcCaret.right = rcCaret.left + widthOverstrikeCaret - 1; - } else if ((vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride) { + } else if ((vsDraw.caretStyle == CARETSTYLE_BLOCK || vsDraw.caretStyle == CARETSTYLE_BLOCK_ALWAYS) || imeCaretBlockOverride) { /* Block caret */ rcCaret.left = xposCaret; if (!caretAtEOL && !caretAtEOF && (ll->chars[offset] != '\t') && !(IsControlCharacter(ll->chars[offset]))) { diff --git a/src/EditView.h b/src/EditView.h index f649f7c87..300dc92a9 100644 --- a/src/EditView.h +++ b/src/EditView.h @@ -54,7 +54,7 @@ public: int tabWidthMinimumPixels; bool hideSelection; - bool drawOverstrikeCaret; + bool drawOverstrikeCaret; // used by the curses platform /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to * the screen. This avoids flashing but is about 30% slower. */ diff --git a/src/Editor.cxx b/src/Editor.cxx index 563b3a665..f48ba333b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1351,7 +1351,7 @@ Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange &ran newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.left) - 2; } else if (pt.x + xOffset >= rcClient.right + newXY.xOffset) { newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 2; - if ((vs.caretStyle == CARETSTYLE_BLOCK) || view.imeCaretBlockOverride) { + if ((vs.caretStyle == CARETSTYLE_BLOCK || vs.caretStyle == CARETSTYLE_BLOCK_ALWAYS) || view.imeCaretBlockOverride) { // Ensure we can see a good portion of the block caret newXY.xOffset += static_cast<int>(vs.aveCharWidth); } @@ -7277,7 +7277,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return vs.caretcolour.AsInteger(); case SCI_SETCARETSTYLE: - if (wParam <= CARETSTYLE_BLOCK) + if (wParam <= CARETSTYLE_BLOCK_ALWAYS) vs.caretStyle = static_cast<int>(wParam); else /* Default to the line caret */ |