diff --git a/uppsrc/CodeEditor/CHighlight.cpp b/uppsrc/CodeEditor/CHighlight.cpp index 3bef53a3c..1be1d68bf 100644 --- a/uppsrc/CodeEditor/CHighlight.cpp +++ b/uppsrc/CodeEditor/CHighlight.cpp @@ -86,6 +86,21 @@ const wchar *HighlightNumber(HighlightOutput& hls, const wchar *p, bool ts, bool return p; } +const wchar *CSyntax::DoComment(HighlightOutput& hls, const wchar *p, const wchar *e) +{ + String w; + for(const wchar *s = p; s < e && IsAlpha(*s) && w.GetCount() < 5; s++) + w.Cat(ToUpper(*s)); + int n = w.GetCount(); + if(findarg(w, "TODO", "FIXME") >= 0) + hls.Put(n, hl_style[INK_COMMENT_WORD], hl_style[PAPER_COMMENT_WORD]); + else { + n = max(n, 1); + hls.Put(n, hl_style[INK_COMMENT]); + } + return p + n; +} + void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls, CodeEditor *editor, int line, int pos) { ONCELOCK { @@ -168,22 +183,23 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls bool is_comment = false; while(p < e) { int pair = MAKELONG(p[0], p[1]); - if(linecomment && linecont || pair == MAKELONG('/', '/') && highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) { - hls.Put(linelen + 1 - hls.pos, hl_style[INK_COMMENT]); + if(linecomment && linecont || pair == MAKELONG('/', '/') && + highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) { + while(p < e) + p = DoComment(hls, p, e); is_comment = true; break; } else - if(comment && highlight != HIGHLIGHT_JSON) + if(comment && highlight != HIGHLIGHT_JSON) { if(pair == MAKELONG('*', '/')) { hls.Put(2, hl_style[INK_COMMENT]); p += 2; comment = false; } - else { - hls.Put(hl_style[INK_COMMENT]); - p++; - } + else + p = DoComment(hls, p, e); + } else if((*p == '\"' || *p == '\'') || linecont && string) p = hls.CString(p); diff --git a/uppsrc/CodeEditor/CSyntax.h b/uppsrc/CodeEditor/CSyntax.h index bd6d44543..0d5d546db 100644 --- a/uppsrc/CodeEditor/CSyntax.h +++ b/uppsrc/CodeEditor/CSyntax.h @@ -42,6 +42,7 @@ protected: static int LoadSyntax(const char *keywords[], const char *names[]); static int InitUpp(const char **q); static void InitKeywords(); + static const wchar *DoComment(HighlightOutput& hls, const wchar *p, const wchar *e); static Vector< Index > keyword; static Vector< Index > name; diff --git a/uppsrc/CodeEditor/Style.cpp b/uppsrc/CodeEditor/Style.cpp index 759e75e6d..16619d3eb 100644 --- a/uppsrc/CodeEditor/Style.cpp +++ b/uppsrc/CodeEditor/Style.cpp @@ -108,6 +108,8 @@ String HighlightSetup::StoreHlStyles() void HighlightSetup::DefaultHlStyles() { SetHlStyle(INK_COMMENT, Green, false, true); + SetHlStyle(PAPER_COMMENT_WORD, Yellow, false, false); + SetHlStyle(INK_COMMENT_WORD, Blue, true, true); SetHlStyle(INK_CONST_STRING, Red); SetHlStyle(INK_CONST_STRINGOP, LtBlue); diff --git a/uppsrc/CodeEditor/hl_color.i b/uppsrc/CodeEditor/hl_color.i index e77848040..0529b4567 100644 --- a/uppsrc/CodeEditor/hl_color.i +++ b/uppsrc/CodeEditor/hl_color.i @@ -8,6 +8,8 @@ HL_COLOR(INK_DISABLED, t_("Disabled text"), 1) HL_COLOR(PAPER_READONLY, t_("Read only background"), 0) HL_COLOR(INK_COMMENT, t_("Comment text"), 1) +HL_COLOR(INK_COMMENT_WORD, t_("FIXME/TODO text in comment"), 0) +HL_COLOR(PAPER_COMMENT_WORD, t_("FIXME/TODO paper in comment"), 0) HL_COLOR(INK_CONST_STRING, t_("String constant text"), 1) HL_COLOR(INK_OPERATOR, t_("Operator text"), 1) HL_COLOR(INK_KEYWORD, t_("Keyword text"), 1) diff --git a/uppsrc/CtrlCore/init b/uppsrc/CtrlCore/init index 27c33a181..aa63470cf 100644 --- a/uppsrc/CtrlCore/init +++ b/uppsrc/CtrlCore/init @@ -3,7 +3,7 @@ #include "Draw/init" #include "plugin\bmp/init" #include "RichText/init" -#define BLITZ_INDEX__ Fe2ff541f9bb9f4ad3f5bcc23a34e1b73 +#define BLITZ_INDEX__ F656a4ea94e4f808b1ec63034b0e6c5ac #include "CtrlCore.icpp" #undef BLITZ_INDEX__ #endif diff --git a/uppsrc/CtrlLib/FrameSplitter.cpp b/uppsrc/CtrlLib/FrameSplitter.cpp index b055d77e6..09ce13b86 100644 --- a/uppsrc/CtrlLib/FrameSplitter.cpp +++ b/uppsrc/CtrlLib/FrameSplitter.cpp @@ -90,7 +90,8 @@ void SplitterFrame::MouseMove(Point p, dword keyflags) void SplitterFrame::LeftUp(Point p, dword keyflags) { - Refresh(); + Refresh(); + ReleaseCapture(); } Image SplitterFrame::CursorImage(Point p, dword keyflags)