Fix auto-insert for xml comment incorrect insertion (closes #598, fixes

Skip auto-insertion detection for xml comment tag.
pull/958/merge
dail8859 2015-09-22 18:15:57 -04:00 committed by Don Ho
parent be057973bc
commit dd31ea2e66
1 changed files with 5 additions and 2 deletions

View File

@ -382,12 +382,15 @@ 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[3];
_pEditView->getText(tagHead, targetStart, targetStart+2);
char tagHead[5];
_pEditView->getText(tagHead, targetStart, targetStart+4);
if (tagHead[1] == '/') // "</toto>" will be ignored
return;
if (strncmp(tagHead, "<!--", 4) == 0) // Comments will be ignored
return;
char tagTail[2];
_pEditView->getText(tagTail, caretPos-2, caretPos-1);