forked from mia/Aegisub
Fix syntax highlighting for multiple karaoke templater expression blocks
This commit is contained in:
parent
28705000bb
commit
cccd95941d
3 changed files with 11 additions and 2 deletions
|
@ -167,7 +167,7 @@ struct dialogue_tokens : lex::lexer<Lexer> {
|
|||
using namespace agi::ass::DialogueTokenType;
|
||||
|
||||
if (karaoke_templater)
|
||||
init(string("!.*!", KARAOKE_TEMPLATE) | string("\\$[A-Za-z_]+", KARAOKE_VARIABLE));
|
||||
init(string("![^!]*!", KARAOKE_TEMPLATE) | string("\\$[A-Za-z_]+", KARAOKE_VARIABLE));
|
||||
else
|
||||
init(lex::char_('\1'));
|
||||
}
|
||||
|
|
|
@ -26,9 +26,10 @@ SRC = \
|
|||
libaegisub_keyframe.cpp \
|
||||
libaegisub_line_iterator.cpp \
|
||||
libaegisub_line_wrap.cpp \
|
||||
libaegisub_option.cpp \
|
||||
libaegisub_mru.cpp \
|
||||
libaegisub_option.cpp \
|
||||
libaegisub_signals.cpp \
|
||||
libaegisub_syntax_highlight.cpp \
|
||||
libaegisub_thesaurus.cpp \
|
||||
libaegisub_util.cpp \
|
||||
libaegisub_vfr.cpp \
|
||||
|
|
|
@ -251,3 +251,11 @@ TEST(lagi_syntax, templater_expression) {
|
|||
expect_style(ss::NORMAL, 1u);
|
||||
);
|
||||
}
|
||||
|
||||
TEST(lagi_syntax, multiple_templater_expressions) {
|
||||
tok_str("!1!2!3!", true,
|
||||
expect_style(ss::KARAOKE_TEMPLATE, 3u);
|
||||
expect_style(ss::NORMAL, 1u);
|
||||
expect_style(ss::KARAOKE_TEMPLATE, 3u);
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue