diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index ab37472a9..c395592c1 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -364,11 +364,12 @@ bool AutoCompletion::showFunctionComplete() return false; } -void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t caretPos) +void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t caretPos, bool isHTML) { int flags = SCFIND_REGEXP | SCFIND_POSIX; _pEditView->execute(SCI_SETSEARCHFLAGS, flags); TCHAR tag2find[] = TEXT("<[^\\s>]*"); + int targetStart = _pEditView->searchInTarget(tag2find, lstrlen(tag2find), caretPos, 0); if (targetStart == -1 || targetStart == -2) @@ -382,8 +383,8 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car if (size_t(foundTextLen) > closeTagSize - 2) // buffer size is not large enough. -2 for '/' & '\0' return; - char tagHead[5]; - _pEditView->getText(tagHead, targetStart, targetStart+4); + char tagHead[10]; + _pEditView->getText(tagHead, targetStart, targetStart+9); if (tagHead[1] == '/') // "" will be ignored return; @@ -391,6 +392,16 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car if (strncmp(tagHead, "