micro icon indicating copy to clipboard operation
micro copied to clipboard

issue with highlighting

Open Drsheppard01 opened this issue 1 year ago • 3 comments

Text of error: Error parsing syntax file sh: interface conversion: interface {} is nil, not []interface {}

Commit hash: 2.0.14 OS: Chimera Linux (it uses Musl) Terminal: Gnome Console 47.1

P.S. When I wrote this issue and checked the available versions, I tried the nightly build and the nightly build didn't have this problem.

Could you please make new release?

Drsheppard01 avatar Oct 01 '24 00:10 Drsheppard01

I am unable to reproduce the error on 2.0.14. Does this happen even if you start micro with a clean config directory [^1]? If not, please share your sh syntax file (typically located under ~/.config/micro/syntax/) – there is likely a mistake in it.

[^1]: you can specify a temporary directory as the config directory by running micro -config-dir $(mktemp -d)

Andriamanitra avatar Oct 02 '24 02:10 Andriamanitra

I tried testing a bit but I think the error occured because sh.yaml in master was copied and used. Empty rules did not have to be defined anymore in regions when #3458 was merged after v2.0.14 was released so they have been removed in builtin syntax files. Syntax files in v2.0.14 can be seen in this link or when switching to the tag in the file list page: https://github.com/zyedidia/micro/tree/v2.0.14/runtime/syntax

I was thinking that it may be better to add a notice about incompatibility that can be seen when looking at runtime files on GitHub, but README.md in directories cannot be easily seen when looking at files or directories with a lot of files.

niten94 avatar Oct 02 '24 04:10 niten94

I tried testing a bit but I think the error occured because sh.yaml in master was copied and used. Empty rules did not have to be defined anymore in regions when #3458 was merged after v2.0.14 was released so they have been removed in builtin syntax files.

Indeed this sounds to be the most likely case.

I was thinking that it may be better to add a notice about incompatibility that can be seen when looking at runtime files on GitHub, but README.md in directories cannot be easily seen when looking at files or directories with a lot of files.

No, the README.md is not a good place for that and offers a high risk to be ignored. Since the runtime files (colorschemes, plugins and syntax) files highly depend on the related SW interfaces it is better to add a kind of a interface version description into these files. On incompatible changes they should be incremented on both sides as well as checked for compatibility in SW. If they don't fit a precise error message is the better way to tell the user what's going wrong.

JoeKar avatar Oct 02 '24 16:10 JoeKar

I also ran into this issue and simply copied sh.yaml from commit 4911a56 (last commit before the empty rules were removed)

dicktyr avatar Jan 16 '25 05:01 dicktyr

With #3697 we added this hint into the documentation and therefore close this issue now too.

JoeKar avatar Mar 16 '25 09:03 JoeKar