Skip to content

Commit

Permalink
Merge pull request #152 from rodjek/fix_syntax_global_var
Browse files Browse the repository at this point in the history
fix: in some cases the syntax file can be evaluated before ftplugin
  • Loading branch information
lelutin committed Sep 12, 2024
2 parents 8f6abca + be2a608 commit 25a8454
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Provides
* Formatting based on the latest Puppetlabs Style Guide
* Syntax highlighting compatible with puppet 4.x
* by default, highlights errors: mixing spaces and tabs and bad names. If you
don't want this highlighting, add `let g:puppet_display_errors = v:false`
(or really any value that's not `v:true`) to your vimrc.
don't want this highlighting, add `let g:puppet_display_errors = 0` to your
vimrc.
* Automatic => alignment
* If you don't like that, add `let g:puppet_align_hashes = 0` to your vimrc.
* Ctags support
Expand Down
4 changes: 0 additions & 4 deletions ftplugin/puppet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ setlocal commentstring=#\ %s

setlocal formatexpr=puppet#format#Format()

if !exists('g:puppet_display_errors')
let g:puppet_display_errors = v:true
endif

let b:undo_ftplugin = '
\ setlocal tabstop< tabstop< softtabstop< shiftwidth< expandtab<
\| setlocal keywordprg< iskeyword< comments< commentstring<
Expand Down
6 changes: 5 additions & 1 deletion syntax/puppet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ endif
let s:cpo_sav = &cpo
set cpo&vim

if !exists('g:puppet_display_errors')
let g:puppet_display_errors = 1
endif

syn cluster puppetNotTop contains=@puppetExtendedStringSpecial,@puppetRegexpSpecial,puppetTodo

syn match puppetSpaceError display excludenl "\s\+$"
Expand Down Expand Up @@ -282,7 +286,7 @@ hi def link puppetFunction Function
hi def link puppetDeprecated Ignore
hi def link puppetDebug Debug

if g:puppet_display_errors ==# v:true
if g:puppet_display_errors
hi def link puppetInvalidNumber Error
hi def link puppetNameBad Error
hi def link puppetSpaceError Error
Expand Down

0 comments on commit 25a8454

Please sign in to comment.