Closed marekkon closed 6 years ago
what syntax script are you using and how do you set this option?
I forgot to mention that I use neovim.
I use the default syntax, but also tried it with 'StanAngeloff/php.vim'
.
Highlight is set in local colorscheme (nvim/colors
). Directly setting this in init.vim
gives the same effect.
Can you provide complete phpParent highlight example please?
Currently it is
hi link PhpParent Normal
but earlier it was (same effect)
hi link PhpParent guifg=#999b9e
After some additional tests it turned out that any use of the PhpParent causes malfunction. E.g. if I comment out PhpParent highlight but leave something like this:
hi link jsonBraces PhpParent
then indentation doesn't work either.
I'm sorry but I'm still unable to reproduce this issue. I was using GVim8.0.69, I've just compiled the latest 8.0.514 and I still can't reproduce the issue.
You're probably experiencing a bug from your version of vim.
The indent script relies on the syntax name attribute to decide if the element needs indentation or not.
Put your cursor on a brace and run the following command:
:echo synIDattr(synID(line("."), col("."), 0), "name")
it should write phpParent
. The indent script ignores almost everything that doesn't start with 'php'.
PhpParent
it is.
Vim doesn't care about the case of the highlight groups. It considers phpParent
the same as PhpParent
. This means that if the user defines PhpParent
before the syntax script defines phpParent
, the synID information will report PhpParent
.
The indent script probably should remove case-sensitive requirement for the matches.
if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment
Wow, so simple fix after all this time. Thanks.
@marekkon: I never noticed the uppercase P of PhpParent
in your comments...
I would never think that it matters, especially since the rest of the highlight groups start with uppercase letters and they don't cause problems.
I get: