I noticed some strange behaviour in the syntax highlighting of a .spec file, when an %install directive is present. For example, take the following spec file and open it in IntelliJ:
Name: Some name
Version: 0.0.1
%install
mktemp -d
%files
%defattr(-,-,-,-)
/opt/some/file
IntelliJ shows it like this:
Note the non-highlighted %files directive. If I now put my cursor at the end of the line containing %files and I press <enter>, the line becomes highlighted in yellow. If I then press <del> to remove the newly added line, the %files directive remains yellow. Until I close the file and open it again, then it's not recognised and white again.
It seems to happen after all directives from the SHELL_SECTIONS constant. For example: if I change %install into %description, the problem is gone. If I change it to %build, the issue is there as well.
Reproduction steps
Create a simple .spec file with an %install directive, followed by a %files directive.
Notice that the %files directive is not highlighted.
Expected behavior
I expect the %files directive to be highlighted in yellow, regardless of the presence of an %install directive before it.
Additional context
Using IntelliJ 2022.3 with plugin version 2.1.0. I reproduced it with ./gradlew runIde.
Describe the bug
I noticed some strange behaviour in the syntax highlighting of a .spec file, when an
%install
directive is present. For example, take the following spec file and open it in IntelliJ:IntelliJ shows it like this:
Note the non-highlighted
%files
directive. If I now put my cursor at the end of the line containing%files
and I press<enter>
, the line becomes highlighted in yellow. If I then press<del>
to remove the newly added line, the%files
directive remains yellow. Until I close the file and open it again, then it's not recognised and white again.It seems to happen after all directives from the SHELL_SECTIONS constant. For example: if I change
%install
into%description
, the problem is gone. If I change it to%build
, the issue is there as well.Reproduction steps
%install
directive, followed by a%files
directive.%files
directive is not highlighted.Expected behavior
I expect the
%files
directive to be highlighted in yellow, regardless of the presence of an%install
directive before it.Additional context
Using IntelliJ 2022.3 with plugin version 2.1.0. I reproduced it with
./gradlew runIde
.