vladvro
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору SciLexer.h строка 427 Код: #define SCE_ERR_FIND_VALUE 30 //!-add-[FindResultListStyle] | Данный код внедрен в форум с помощью скрипта vladvro LexOthers.cxx строка 1005 Код: //!-start-[FindResultListStyle] static bool RecogniseFindListStart(const char *lineBuffer, char *findValue) { if (strstart(lineBuffer, ">Internal search for \"")) { unsigned int p = 22; while (0 != strncmp(lineBuffer + p, "\" in \"", 6)) { p++; if (p > 1022) return false; } strncpy(findValue, lineBuffer + 22, p - 22); findValue[p - 22] = '\0'; return true; } return false; } static void ColouriseFindListLine( const char *lineBuffer, unsigned int lengthLine, unsigned int startPos, unsigned int endPos, char *findValue, Accessor &styler) { int len = strlen(findValue); unsigned int p = 0; while (true) { while (0 != strnicmp(lineBuffer + p, findValue, len)) { p++; if (p > lengthLine - len) { p = lengthLine; break; } } if (p < lengthLine) { styler.ColourTo(startPos + p, SCE_ERR_DEFAULT); styler.ColourTo(startPos + p + len, SCE_ERR_FIND_VALUE); p += len; } else { break; } } styler.ColourTo(endPos, SCE_ERR_DEFAULT); } //!-end-[FindResultListStyle] static void ColouriseErrorListLine( char *lineBuffer, unsigned int lengthLine, unsigned int startPos, //!-add-[FindResultListStyle] unsigned int endPos, bool isFindListStyle, //!-add-[FindResultListStyle] bool &isFindList, //!-add-[FindResultListStyle] char *findValue, //!-add-[FindResultListStyle] Accessor &styler) { //!-start-[FindResultListStyle] unsigned int styleLength = 0; int stl = RecogniseErrorListLine(lineBuffer, lengthLine, styleLength); if (isFindListStyle && stl == SCE_ERR_GCC) { styler.ColourTo(startPos + styleLength, stl); if (isFindList) { ColouriseFindListLine(lineBuffer + styleLength + 1, lengthLine - styleLength - 1, startPos + styleLength, endPos, findValue, styler); } else { styler.ColourTo(endPos, SCE_ERR_DEFAULT); } } else { if (isFindListStyle && stl == SCE_ERR_CMD) { isFindList = RecogniseFindListStart(lineBuffer, findValue); if (!isFindList) findValue[0] = '\0'; } styler.ColourTo(endPos, stl); } //!-end-[FindResultListStyle] } static void ColouriseErrorListDoc(unsigned int startPos, int length, int, WordList *[], Accessor &styler) { char lineBuffer[10000]; styler.StartAt(startPos); styler.StartSegment(startPos); unsigned int linePos = 0; //!-start-[FindResultListStyle] unsigned int startLine = startPos; bool isFindListStyle = styler.GetPropertyInt("lexer.errorlist.findliststyle", 0) == 1; static bool isFindList; static char findValue[1000]; //!-end-[FindResultListStyle] for (unsigned int i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseErrorListLine(lineBuffer, linePos, startLine, i, isFindListStyle, isFindList, findValue, styler); //!-change-[FindResultListStyle] linePos = 0; startLine = i + 1; //!-add-[FindResultListStyle] } } if (linePos > 0) { // Last line does not have ending characters ColouriseErrorListLine(lineBuffer, linePos, startLine, startPos + length - 1, isFindListStyle, isFindList, findValue, styler); //!-change-[FindResultListStyle] } } | Данный код внедрен в форум с помощью скрипта vladvro и задаем стиль для выделения искомого слова others_.properties строка 152 Код: # Search value style.errorlist.30=fore:#000000,bold | Данный код внедрен в форум с помощью скрипта vladvro | Всего записей: 281 | Зарегистр. 05-04-2006 | Отправлено: 14:56 25-05-2007 | Исправлено: vladvro, 16:30 26-05-2007 |
|