From d8973543addec27aa75cb35bfc2f5d3486f438f7 Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 9 Jul 2008 16:27:15 +0000 Subject: [PATCH] [BUG_FIXED] Fix tags match highlighter bug. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@282 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 23 +++++++++++++++++------ PowerEditor/src/stylers.model.xml | 1 + 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 86f6c80a..5f89b800 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2495,8 +2495,21 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * if (ltPosOnR == -1) return false; - if ((direction == search2Left) && (getTagCategory(tagsPos, ltPosOnR+2) != tagOpen)) + TagCateg tc = outOfTag; + if (direction == search2Left) + { + tc = getTagCategory(tagsPos, ltPosOnR+2); + + if (tc != tagOpen && tc != inSingleTag) return false; + if (tc == inSingleTag) + { + int start = foundPos.first; + int end = searchEnd; + return getMatchedTagPos(start, end, tag2find, oppositeTag2find, oppositeTagFound, tagsPos); + } + //oppositeTagFound.push_back(foundPos.first); + } pair oppositeTagPos; int s = foundPos.first; @@ -2513,16 +2526,14 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * { if (direction == search2Left) { - return true;//(getTagCategory(tagsPos, ltPosOnR+2) == tagOpen); - //tagsPos.tagOpenStart = foundPos.first; - //tagsPos.tagOpenEnd = foundPos.second; + return true; } else { tagsPos.tagCloseStart = foundPos.first; tagsPos.tagCloseEnd = foundPos.second; + return true; } - return true; } else if (isInList(ltTag, oppositeTagFound)) { @@ -2533,7 +2544,7 @@ bool Notepad_plus::getMatchedTagPos(int searchStart, int searchEnd, const char * { if (direction == search2Left) { - return true;//(getTagCategory(tagsPos, ltPosOnR+2) == tagOpen); + return true; } else { diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 11dfad45..886c9652 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -263,6 +263,7 @@ +