Improve language colorizers (#54)

* fix detection of javascript partial comments in diff output
* colorize python annotations
* add simplistic yaml colorizer
* colorize .gitignore files
* improve shell buffer diff output colorization
This commit is contained in:
Charlie Gordon 2024-12-14 23:56:54 +01:00 • committed by GitHub
commit e4fb8c8428
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 86 additions and 22 deletions

View file

@ -57,6 +57,7 @@ enum {
PYTHON_STYLE_KEYWORD = QE_STYLE_KEYWORD,
PYTHON_STYLE_FUNCTION = QE_STYLE_FUNCTION,
PYTHON_STYLE_REGEX = QE_STYLE_STRING,
PYTHON_STYLE_ANNOTATION = QE_STYLE_PREPROCESS,
};
enum { // Python flavors
@ -103,6 +104,11 @@ static void python_colorize_line(QEColorizeContext *cp,
style = PYTHON_STYLE_COMMENT;
break;
case '@':
i += ustr_get_identifier(kbuf, countof(kbuf), c, str, i, n);
style = PYTHON_STYLE_ANNOTATION;
break;
case '\'':
case '\"':
/* parse string constant */