Support # comments in commands

This commit is contained in:
Maxime Coste 2012-09-04 00:04:49 +02:00
parent 57b89099ec
commit d530a2d864
2 changed files with 6 additions and 0 deletions

View File

@ -88,6 +88,11 @@ TokenList parse(const String& line,
++pos; ++pos;
else if (line[pos] == '\\' and pos+1 < length and line[pos+1] == '\n') else if (line[pos] == '\\' and pos+1 < length and line[pos+1] == '\n')
pos += 2; pos += 2;
else if (line[pos] == '#')
{
while (pos != length and line[pos] != '\n')
++pos;
}
else else
break; break;
} }

View File

@ -10,6 +10,7 @@ hook global WinSetOption filetype=kak %{
addhl -group kak-highlight regex (?<=\<regex)\h+(\S+) 1:magenta addhl -group kak-highlight regex (?<=\<regex)\h+(\S+) 1:magenta
addhl -group kak-highlight regex (["'])(?:\\\1|.)*?\1 0:magenta addhl -group kak-highlight regex (["'])(?:\\\1|.)*?\1 0:magenta
addhl -group kak-highlight regex (?<=\<set[gbw])\h+(\S+)\h+(\S+) 1:magenta 2:red addhl -group kak-highlight regex (?<=\<set[gbw])\h+(\S+)\h+(\S+) 1:magenta 2:red
addhl -group kak-highlight regex \#[^\n]*\n 0:cyan
} }
hook global WinSetOption filetype=(?!kak).* %{ hook global WinSetOption filetype=(?!kak).* %{