aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2023-11-07 13:46:00 +1100
committerZufu Liu <unknown>2023-11-07 13:46:00 +1100
commitcba3701a6c1a67b839ebe567992e004d1ac4d7f1 (patch)
tree94f43861d4c13a020d8473569f7891178da1fd5c
parent40c0b2cef161f93209b1c8384f6429d181b6e054 (diff)
downloadscintilla-mirror-cba3701a6c1a67b839ebe567992e004d1ac4d7f1.tar.gz
Feature [feature-requests:#1501] More use of LineStartPosition, LineEndPosition.
-rw-r--r--src/Document.cxx3
-rw-r--r--src/Editor.cxx2
-rw-r--r--src/ScintillaBase.cxx5
-rw-r--r--win32/ScintillaWin.cxx2
4 files changed, 4 insertions, 8 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 5d9e10c40..a35105669 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2404,8 +2404,7 @@ void Document::EnsureStyledTo(Sci::Position pos) {
if ((enteredStyling == 0) && (pos > GetEndStyled())) {
IncrementStyleClock();
if (pli && !pli->UseContainerLexing()) {
- const Sci::Line lineEndStyled = SciLineFromPosition(GetEndStyled());
- const Sci::Position endStyledTo = LineStart(lineEndStyled);
+ const Sci::Position endStyledTo = LineStartPosition(GetEndStyled());
pli->Colourise(endStyledTo, pos);
} else {
// Ask the watchers to style, and stop as soon as one responds.
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 796279871..0b65041d2 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3750,7 +3750,7 @@ int Editor::DelWordOrLine(Message iMessage) {
case Message::DelLineRight:
rangeDelete = Range(
sel.Range(r).caret.Position(),
- pdoc->LineEnd(pdoc->LineFromPosition(sel.Range(r).caret.Position())));
+ pdoc->LineEndPosition(sel.Range(r).caret.Position()));
break;
default:
break;
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 9d0c79c06..a629cdd33 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -804,10 +804,7 @@ const char *LexState::DescriptionOfStyle(int style) {
void ScintillaBase::NotifyStyleToNeeded(Sci::Position endStyleNeeded) {
if (!DocumentLexState()->UseContainerLexing()) {
- const Sci::Line lineEndStyled =
- pdoc->SciLineFromPosition(pdoc->GetEndStyled());
- const Sci::Position endStyled =
- pdoc->LineStart(lineEndStyled);
+ const Sci::Position endStyled = pdoc->LineStartPosition(pdoc->GetEndStyled());
DocumentLexState()->Colourise(endStyled, endStyleNeeded);
return;
}
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index be910d0f9..7ff979bbf 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -3135,7 +3135,7 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
} else {
// Ensure docCompStart+docCompLen be not beyond lineEnd.
// since docCompLen by byte might break eol.
- const Sci::Position lineEnd = pdoc->LineEnd(pdoc->LineFromPosition(rBase));
+ const Sci::Position lineEnd = pdoc->LineEndPosition(rBase);
const Sci::Position overflow = (docCompStart + docCompLen) - lineEnd;
if (overflow > 0) {
pdoc->DeleteChars(docCompStart, docCompLen - overflow);