diff options
author | Zufu Liu <unknown> | 2020-07-15 12:08:11 +1000 |
---|---|---|
committer | Zufu Liu <unknown> | 2020-07-15 12:08:11 +1000 |
commit | 8aeb0e4b77a0f6905981df5f2d9c4622d55a12fb (patch) | |
tree | 91988ba86d2aabf316a1cb7340c0b181f0a02ba6 /src/Document.cxx | |
parent | 94e723891ade7b0de0c6dc6a3b294e6ce1fea326 (diff) | |
download | scintilla-mirror-8aeb0e4b77a0f6905981df5f2d9c4622d55a12fb.tar.gz |
Feature [feature-requests:1368]. Add BraceMatchNext API.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index dcb26acdf..95792fa1f 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2657,7 +2657,7 @@ static char BraceOpposite(char ch) noexcept { } // TODO: should be able to extend styled region to find matching brace -Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxReStyle*/) noexcept { +Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxReStyle*/, Sci::Position startPos, bool useStartPos) noexcept { const char chBrace = CharAt(position); const char chSeek = BraceOpposite(chBrace); if (chSeek == '\0') @@ -2667,7 +2667,7 @@ Sci::Position Document::BraceMatch(Sci::Position position, Sci::Position /*maxRe if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') direction = 1; int depth = 1; - position = NextPosition(position, direction); + position = useStartPos ? startPos : NextPosition(position, direction); while ((position >= 0) && (position < LengthNoExcept())) { const char chAtPos = CharAt(position); const int styAtPos = StyleIndexAt(position); |