mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Merge branch '3487_syntax_highlighting_fixes'
* 3487_syntax_highlighting_fixes: mcedit: fixed syntax highlighting bug in .c and .cxx syntax scripts Ticket #3487: mcedit: fixed invalid syntax highlighting
This commit is contained in:
commit
e2b8a50cea
@ -36,7 +36,7 @@ context default
|
||||
keyword whole inline yellow
|
||||
keyword whole wchar_t yellow
|
||||
keyword whole ... yellow
|
||||
keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
|
||||
keyword linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
|
||||
keyword whole \[\s\t\]default yellow
|
||||
keyword whole linestart \[\s\t\]\{ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\}\[0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]: cyan
|
||||
|
||||
|
@ -62,7 +62,7 @@ context default
|
||||
keyword whole using yellow
|
||||
keyword whole wchar_t yellow
|
||||
keyword whole ... yellow
|
||||
keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
|
||||
keyword linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
|
||||
|
||||
keyword /\* brown
|
||||
keyword \*/ brown
|
||||
|
@ -446,6 +446,16 @@ apply_rules_going_right (WEdit * edit, off_t i)
|
||||
k->whole_word_chars_right, k->line_start);
|
||||
if (e > 0)
|
||||
{
|
||||
/* when both context and keyword terminate with a newline,
|
||||
the context overflows to the next line and colorizes it incorrectly */
|
||||
if (_rule._context != 0 && k->keyword[strlen (k->keyword) - 1] == '\n')
|
||||
{
|
||||
r = CONTEXT_RULE (g_ptr_array_index (edit->rules, _rule._context));
|
||||
if (r->right != NULL && r->right[0] != '\0'
|
||||
&& r->right[strlen (r->right) - 1] == '\n' && e > i + 1)
|
||||
e--;
|
||||
}
|
||||
|
||||
end = e;
|
||||
_rule.end = e;
|
||||
_rule.keyword = count;
|
||||
|
Loading…
Reference in New Issue
Block a user