Skip to content

Commit 4438502

Browse files
committed
Fix another regression in TagFinder
Cf. #9 (comment)
1 parent 31eca02 commit 4438502

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Forms/resource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#include <windows.h>
1212

13-
#define HTMLTAG_VERSION L"1.5.0.2\0"
14-
#define HTMLTAG_VERSION_WORDS 1, 5, 0, 2
13+
#define HTMLTAG_VERSION L"1.5.0.3\0"
14+
#define HTMLTAG_VERSION_WORDS 1, 5, 0, 3
1515

1616
#define ID_ABOUT_HTML_TAG_DLG 0x1000
1717
#define ID_UNICODE_FMT_CONFIG_DLG 0x2000

src/TagFinder.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ void TagFinder::findMatchingTag(SelectionOptions options) {
6868
dispose = false;
6969
searchDirection = processDirection;
7070
} else if (sameText(tagName.substr(1), matchingTags->name.substr(1))) {
71-
if (searchDirection != processDirection && !matchingTags[1].tag)
71+
if (searchDirection != processDirection && !matchingTags[1].tag) {
7272
match = *currentTag;
73-
if (matchingTags[1].tag) {
73+
matchingTags[1] = TagPair{ tagName, currentTag };
74+
dispose = false;
75+
} else if (matchingTags[1].tag) {
7476
delete matchingTags[1].tag;
7577
matchingTags[1].tag = nullptr;
78+
} else if (searchDirection == processDirection) {
79+
matchingTags[1] = TagPair{ tagName, currentTag };
80+
dispose = false;
7681
}
77-
matchingTags[1] = TagPair{ tagName, currentTag };
78-
dispose = false;
7982
}
8083
};
8184
// --------------------------------------------------------------------------------------
@@ -171,9 +174,6 @@ void TagFinder::findMatchingTag(SelectionOptions options) {
171174
}
172175
} while (nextTag && !match);
173176

174-
if (matchingTags[1].tag)
175-
match = *matchingTags[1].tag;
176-
177177
if (match) {
178178
if (matchingTags[1].tag) {
179179
currentTag = matchingTags->tag;

0 commit comments

Comments
 (0)