Revert "Skip auto-complete of <?xml> tag"
This reverts commit 9183281921
.
This commit is contained in:
parent
797765173d
commit
ace8a4cf58
@ -368,7 +368,7 @@ bool AutoCompletion::showFunctionComplete()
|
||||
return false;
|
||||
}
|
||||
|
||||
void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t caretPos, LangType language)
|
||||
void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t caretPos, bool isHTML)
|
||||
{
|
||||
char prev = (char)_pEditView->execute(SCI_GETCHARAT, caretPos - 2);
|
||||
char prevprev = (char)_pEditView->execute(SCI_GETCHARAT, caretPos - 3);
|
||||
@ -407,9 +407,9 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car
|
||||
if (strncmp(tagHead, "<!--", 4) == 0) // Comments will be ignored
|
||||
return;
|
||||
|
||||
if (language == L_HTML) // for HTML: "br", "hr", "img", "link", "!doctype" and "meta" will be ignored
|
||||
if (isHTML) // for HTML: "br", "hr", "img", "link", "!doctype" and "meta" will be ignored
|
||||
{
|
||||
const char *disallowedTags[] = { "br", "hr", "img", "link", "meta", "!doctype" };
|
||||
char *disallowedTags[] = { "br", "hr", "img", "link", "meta", "!doctype" };
|
||||
size_t disallowedTagsLen = sizeof(disallowedTags) / sizeof(char *);
|
||||
for (size_t i = 0; i < disallowedTagsLen; ++i)
|
||||
{
|
||||
@ -417,12 +417,6 @@ void AutoCompletion::getCloseTag(char *closeTag, size_t closeTagSize, size_t car
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (language == L_XML)
|
||||
{
|
||||
// Ignore "?xml"
|
||||
if (strnicmp(tagHead + 1, "?xml", strlen("?xml")) == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
closeTag[0] = '<';
|
||||
closeTag[1] = '/';
|
||||
@ -642,7 +636,7 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m
|
||||
{
|
||||
if (matchedPairConf._doHtmlXmlTag && (_curLang == L_HTML || _curLang == L_XML))
|
||||
{
|
||||
getCloseTag(closeTag, tagMaxLen, caretPos, _curLang);
|
||||
getCloseTag(closeTag, tagMaxLen, caretPos, _curLang == L_HTML);
|
||||
if (closeTag[0] != '\0')
|
||||
matchedChars = closeTag;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
void insertMatchedChars(int character, const MatchedPairConf & matchedPairConf);
|
||||
void update(int character);
|
||||
void callTipClick(int direction);
|
||||
void getCloseTag(char *closeTag, size_t closeTagLen, size_t caretPos, LangType language);
|
||||
void getCloseTag(char *closeTag, size_t closeTagLen, size_t caretPos, bool isHTML);
|
||||
|
||||
private:
|
||||
bool _funcCompletionActive = false;
|
||||
|
Loading…
Reference in New Issue
Block a user