|
|
|
@ -2276,55 +2276,28 @@ bool Notepad_plus::isConditionExprLine(int lineNumber)
|
|
|
|
|
|
|
|
|
|
int startPos = _pEditView->execute(SCI_POSITIONFROMLINE, lineNumber);
|
|
|
|
|
int endPos = _pEditView->execute(SCI_GETLINEENDPOSITION, lineNumber);
|
|
|
|
|
_pEditView->execute(SCI_SETSEARCHFLAGS, SCFIND_REGEXP | SCFIND_POSIX);
|
|
|
|
|
_pEditView->execute(SCI_SETTARGETSTART, startPos);
|
|
|
|
|
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
LangType type = _pEditView->getCurrentBuffer()->getLangType();
|
|
|
|
|
|
|
|
|
|
if (type == L_HTML || type == L_PHP || type == L_ASP || type == L_JSP)
|
|
|
|
|
mask = INDIC2_MASK;
|
|
|
|
|
else if (type == L_PS)
|
|
|
|
|
mask = 16;
|
|
|
|
|
*/
|
|
|
|
|
const char ifExpr[] = "";
|
|
|
|
|
const char elseExpr[] = "";
|
|
|
|
|
const char forLoopExpr[] = "";
|
|
|
|
|
const char whileLoopExpr[] = "";
|
|
|
|
|
|
|
|
|
|
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(ifExpr), (LPARAM)ifExpr);
|
|
|
|
|
if (posFound != -1 && posFound != -2)
|
|
|
|
|
{
|
|
|
|
|
//int start = int(_pEditView->execute(SCI_GETTARGETSTART));
|
|
|
|
|
int end = int(_pEditView->execute(SCI_GETTARGETEND));
|
|
|
|
|
if (end == endPos)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(elseExpr), (LPARAM)elseExpr);
|
|
|
|
|
if (posFound != -1 && posFound != -2)
|
|
|
|
|
{
|
|
|
|
|
int end = int(_pEditView->execute(SCI_GETTARGETEND));
|
|
|
|
|
if (end == endPos)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(forLoopExpr), (LPARAM)forLoopExpr);
|
|
|
|
|
if (posFound != -1 && posFound != -2)
|
|
|
|
|
{
|
|
|
|
|
int end = int(_pEditView->execute(SCI_GETTARGETEND));
|
|
|
|
|
if (end == endPos)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(whileLoopExpr), (LPARAM)whileLoopExpr);
|
|
|
|
|
if (posFound != -1 && posFound != -2)
|
|
|
|
|
{
|
|
|
|
|
int end = int(_pEditView->execute(SCI_GETTARGETEND));
|
|
|
|
|
if (end == endPos)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
_pEditView->execute(SCI_SETSEARCHFLAGS, SCFIND_REGEXP | SCFIND_POSIX);
|
|
|
|
|
_pEditView->execute(SCI_SETTARGETSTART, startPos);
|
|
|
|
|
_pEditView->execute(SCI_SETTARGETEND, endPos);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
LangType type = _pEditView->getCurrentBuffer()->getLangType();
|
|
|
|
|
|
|
|
|
|
if (type == L_HTML || type == L_PHP || type == L_ASP || type == L_JSP)
|
|
|
|
|
mask = INDIC2_MASK;
|
|
|
|
|
else if (type == L_PS)
|
|
|
|
|
mask = 16;
|
|
|
|
|
*/
|
|
|
|
|
const char ifElseForWhileExpr[] = "((else[ \t]+)?if|for|while)[ \t]*[(].*[)][ \t]*|else[ \t]*";
|
|
|
|
|
|
|
|
|
|
int posFound = _pEditView->execute(SCI_SEARCHINTARGET, strlen(ifElseForWhileExpr), (LPARAM)ifElseForWhileExpr);
|
|
|
|
|
if (posFound != -1 && posFound != -2)
|
|
|
|
|
{
|
|
|
|
|
int end = int(_pEditView->execute(SCI_GETTARGETEND));
|
|
|
|
|
if (end == endPos)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|