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 | c47a76507f5bfd812604504d3b0246fa45be799e (patch) | |
| tree | 9beede23572858a217ff61c2c258d81de78b2597 /src/Document.cxx | |
| parent | b46f4cdda3df7c26dc6cc1c55173c3a1559b20f2 (diff) | |
| download | scintilla-mirror-c47a76507f5bfd812604504d3b0246fa45be799e.tar.gz | |
Backport: Feature [feature-requests:1368]. Add BraceMatchNext API.
Backport of changeset 8406:a2ce85a55dfa.
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 3143e7e1f..a9daf9339 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -2660,7 +2660,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') @@ -2670,7 +2670,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); |
