diff --git a/changelog.md b/changelog.md index d1836d25..27ef500a 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,11 @@ Features * Include a MariaDB server and example data in the Docker image. +Bug Fixes +-------- +* Tokenize leading `/` and `\` as symbol names for better highlighting. + + Documentation -------- * Add `--pull=always` to documented `docker run` command. diff --git a/mycli/lexer.py b/mycli/lexer.py index 4caac56d..1a726ab3 100644 --- a/mycli/lexer.py +++ b/mycli/lexer.py @@ -1,6 +1,6 @@ from pygments.lexer import inherit from pygments.lexers.sql import MySqlLexer -from pygments.token import Keyword +from pygments.token import Keyword, Name class MyCliLexer(MySqlLexer): @@ -8,6 +8,7 @@ class MyCliLexer(MySqlLexer): tokens = { "root": [ + (r'^[/\\]', Name), (r"\brepair\b", Keyword), (r"\boffset\b", Keyword), inherit,