Skip to content

Commit

Permalink
Display options in a cleaner way with syntax highlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
sahib committed Nov 15, 2016
1 parent 0d1d06a commit bae510a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/vim-php.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function! s:DisplayOptions()
setlocal nomodifiable
setlocal statusline=Select\ a\ Class,\ trait\ or\ interface

" Syntax highlighting
" I'm not sure if this is a good place to write syntax highlight :/
syn keyword elementType Class Trait Inter
hi def link elementType Keyword

" This buffer command will be called when user select an option.
command! -buffer PHPSelectOption call s:SelectOption(line('.') - 1)

Expand Down Expand Up @@ -141,7 +146,7 @@ function! s:MakeOptionsList()
for l:tag in s:tags
" Add tail backslash only if the namespace is not empty.
let l:namespace = l:tag.namespace == '' ? '' : l:tag.namespace.'\'
call add(l:options, ' '.l:namespace.l:tag.name.' '.s:GetTagKind(l:tag).' '.l:tag.filename)
call add(l:options, ' '.strpart(s:GetTagKind(l:tag), 0, 5).' '.l:namespace.l:tag.name)
endfor

return l:options
Expand Down

0 comments on commit bae510a

Please sign in to comment.