-
-
Notifications
You must be signed in to change notification settings - Fork 63
syntax: fix TOML / add Kconfig syntax highlighting #5009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
syntax: fix TOML / add Kconfig syntax highlighting #5009
Conversation
* Fix broken comments handling. * Support escapes in basic (double-quoted) strings. * Highlight literal (single-quoted) strings. * Support multi-line strings. * Make tables (sections) easily distinguishable from comments. * Make highlighting of inline tables consistent. * Unify colors with other syntax files like YAML / C / Shell. Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
* Implement Kconfig specification with Kconfiglib extensions. * Highlight the following files: - Kconfig / Kconfig.* - for Linux kernel, U-Boot, Zephyr. - Config.in / Config.in.* / Config.src - for Buildroot, Busybox. - *.kconf / *.kconfig - just alternative extension-based variant. Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
* .config is already highlighted as Java properties => reuse it. It is not ideal, but better than nothing. * Additionally hightlight: - .config.* - e.g. .config.old produced by Kconfig. - *defconfig - used in Linux kernel, Buildroot, Busybox, U-Boot, Zephyr. * Kconfig.defconfig should still be treated as Kconfig definition file, not as its output. Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
|
Please note that I used It looks like Dockerfile file matching rules are incorrect, as all files in Dockerfile* directory will be treated as docker files. |
|
BTW, I decided to highlight kconfig output files as Java properties, just because
|
Actually, there are quite a lot of rules (starting from the very first ones) that assume that we match on the filename and not the full path to the file. @mc-worker, do you know if there is a reason why we actually match on the full path to the file and does it make sense? Maybe we should change this to really only matching on the file name? % git diff
diff --git a/src/editor/syntax.c b/src/editor/syntax.c
index 9ccef28ae..8da7173d8 100644
--- a/src/editor/syntax.c
+++ b/src/editor/syntax.c
@@ -1555,7 +1555,7 @@ edit_load_syntax (WEdit *edit, GPtrArray *pnames, const char *type)
f = mc_config_get_full_path (EDIT_SYNTAX_FILE);
if (edit != NULL)
- r = edit_read_syntax_file (edit, pnames, f, vfs_path_as_str (edit->filename_vpath),
+ r = edit_read_syntax_file (edit, pnames, f, vfs_path_get_last_path_str (edit->filename_vpath),
get_first_editor_line (edit),
auto_syntax ? NULL : edit->syntax_type);
else |
Proposed changes
Improve syntax highlighting:
Highlight Kconfig output files.
Checklist
git commit --amend -smake indent && make check)I've not tried to build / install mc - I tested my changes on existing installation by modifying
/usr/share/mc/syntax/*files.