Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Konfekt opened this issue Oct 9, 2024 · 1 comment
Open

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

Konfekt opened this issue Oct 9, 2024 · 1 comment

Comments

@Konfekt
Copy link
Contributor

Konfekt commented Oct 9, 2024

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
Copy link
Contributor Author

Konfekt commented Oct 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant