From 8ff947c9db5ab9f1a093434180bc05bfecb62c4d Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 31 Mar 2017 18:19:38 +1100 Subject: Using Sci::Position and Sci::Line to mark variables that are document positions and lines. --- src/ScintillaBase.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/ScintillaBase.cxx') diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 27ed95135..0e947b6c8 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -207,24 +207,24 @@ void ScintillaBase::AutoCompleteDoubleClick(void *p) { sci->AutoCompleteCompleted(0, SC_AC_DOUBLECLICK); } -void ScintillaBase::AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen) { +void ScintillaBase::AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen) { UndoGroup ug(pdoc); if (multiAutoCMode == SC_MULTIAUTOC_ONCE) { pdoc->DeleteChars(startPos, removeLen); - const int lengthInserted = pdoc->InsertString(startPos, text, textLen); + const Sci::Position lengthInserted = pdoc->InsertString(startPos, text, textLen); SetEmptySelection(startPos + lengthInserted); } else { // SC_MULTIAUTOC_EACH for (size_t r=0; r= 0) { positionInsert -= removeLen; pdoc->DeleteChars(positionInsert, removeLen); } - const int lengthInserted = pdoc->InsertString(positionInsert, text, textLen); + const Sci::Position lengthInserted = pdoc->InsertString(positionInsert, text, textLen); if (lengthInserted > 0) { sel.Range(r).caret.SetPosition(positionInsert + lengthInserted); sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted); @@ -382,7 +382,7 @@ void ScintillaBase::AutoCompleteCompleted(char ch, unsigned int completionMethod scn.listCompletionMethod = completionMethod; scn.wParam = listType; scn.listType = listType; - Position firstPos = ac.posStart - ac.startLen; + Sci::Position firstPos = ac.posStart - ac.startLen; scn.position = firstPos; scn.lParam = firstPos; scn.text = selected.c_str(); @@ -395,7 +395,7 @@ void ScintillaBase::AutoCompleteCompleted(char ch, unsigned int completionMethod if (listType > 0) return; - Position endPos = sel.MainCaret(); + Sci::Position endPos = sel.MainCaret(); if (ac.dropRestOfWord) endPos = pdoc->ExtendWordSelect(endPos, 1, true); if (endPos < firstPos) @@ -771,11 +771,11 @@ const char *LexState::GetSubStyleBases() { #endif -void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) { +void ScintillaBase::NotifyStyleToNeeded(Sci::Position endStyleNeeded) { #ifdef SCI_LEXER if (DocumentLexState()->lexLanguage != SCLEX_CONTAINER) { - int lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled()); - int endStyled = pdoc->LineStart(lineEndStyled); + Sci::Line lineEndStyled = pdoc->LineFromPosition(pdoc->GetEndStyled()); + Sci::Position endStyled = pdoc->LineStart(lineEndStyled); DocumentLexState()->Colourise(endStyled, endStyleNeeded); return; } @@ -994,10 +994,10 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara case SCI_COLOURISE: if (DocumentLexState()->lexLanguage == SCLEX_CONTAINER) { - pdoc->ModifiedAt(static_cast(wParam)); - NotifyStyleToNeeded((lParam == -1) ? pdoc->Length() : static_cast(lParam)); + pdoc->ModifiedAt(static_cast(wParam)); + NotifyStyleToNeeded((lParam == -1) ? pdoc->Length() : static_cast(lParam)); } else { - DocumentLexState()->Colourise(static_cast(wParam), static_cast(lParam)); + DocumentLexState()->Colourise(static_cast(wParam), static_cast(lParam)); } Redraw(); break; -- cgit v1.2.3