]> git.lizzy.rs Git - micro.git/commit
Fix regression: non-working direct colors in syntax files (#2252)
authorDmitry Maluka <dmitrymaluka@gmail.com>
Wed, 27 Oct 2021 22:12:55 +0000 (00:12 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Oct 2021 22:12:55 +0000 (15:12 -0700)
commit728d87ceba683bf58089a97212a12d814b05ae88
tree69f5d171fa772eacbab398c8f794c05476f20269
parenta6796fcbd967f6d06b4f112f279beb4f78efbe72
Fix regression: non-working direct colors in syntax files (#2252)

After 9ad4437, directly specifying color names (instead of syntax groups)
in syntax files no longer works. In particular *.patch and *.diff files
are not highlighted, since in patch.yaml direct colors names are used.

Restore the previous behavior of GetColor (fallback to direct colors if
no syntax group found) to fix this regression, but also make some changes
in StringToStyle and StringToColor to still fix the issue which was fixed
by 9ad4437. In other words, ensure that there is no confusion between
direct colors ("red", "green" etc) and syntax groups omitted in the
colorscheme file.
internal/config/colorscheme.go