aperezdc / vim-template

Simple templates plugin for Vim
372 stars 152 forks source link

g:sh_fold_enabled > 3 swallows lines of (z)sh templates #158

Open Konfekt opened 1 month ago

Konfekt commented 1 month ago

Any value of

g:sh_fold_enabled > 3

removes lines of (z)sh templates: For example, if =template=.sh reads

#/bin/zsh

if ...

then vim .sh will only show the first line.

Konfekt commented 1 month ago

Here's the relevant code if g:sh_fold_enabled > 3:

" /usr/share/vim/vim91/syntax/sh.vim (lines 275-277)
ShFoldIfDoFor syn region shDo   transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>"         contains=@shLoopList
ShFoldIfDoFor syn region shIf   transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>" contains=@shIfList
ShFoldIfDoFor syn region shFor      matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\>" end="\<do\>"me=e-2          contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn