-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Problematic syntax ftplugin files for folding #16083
Comments
This is a problem with the syntax files, not filetype plugins. |
If I understand correctly, this will just enable syntax-based folding for the embedded javascript/php language. Why do you expect this to enable folding of your RST document? |
As these were added after the line coming before
which entails " /usr/local/share/vim/vim91/ftplugin/rst.vim (lines 37-44)
if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
setlocal foldmethod=expr
setlocal foldexpr=RstFold#GetRstFold()
setlocal foldtext=RstFold#GetRstFoldText()
augroup RstFold
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
augroup END
endif The issues stems from here " syntax/rst.vim (line 230)
exe 'syn include @rst'.s:filetype.' syntax/'.s:filetype.'.vim' since " syntax/javascript.vim (line 82)
setlocal foldmethod=syntax This is a recurring issue and the adhoc fix could be similar; though there should be a more generic solution for stopping embedded syntax filetypes overriding filetype local settings. Implementing such an adhoc fix would then be up @marshallward (respectively @TysonAndre for PHP) |
Maybe simply moving them to |
I think the javascript syntax file should not |
Same for php. I just did a grep for
|
Why should redif.vim|967 col 43| set foldmethod=syntax
racket.vim|18 col 3| set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
progress.vim|25 col 1| set expandtab
natural.vim|147 col 3| set foldignore=*
lisp.vim|28 col 2| set ignorecase
cdl.vim|51 col 1| set foldmethod=expr
cdl.vim|52 col 1| set foldexpr=(getline(v:lnum+1)=~'{'\|\|getline(v:lnum)=~'//\\s\\*\\{5}.*table')?'>1':1
cdl.vim|54 col 1| set foldmethod=manual
2html.vim|28 col 1| set eventignore+=FileType
2html.vim|725 col 1| set notitle noicon
2html.vim|727 col 1| set nomore
2html.vim|728 col 1| set report=1000000
2html.vim|818 col 1| set paste
2html.vim|820 col 1| set magic
2html.vim|1155 col 5| set laststatus=2
dockerfile.vim|38 col 1| set commentstring=#\ %s |
I don't think it should; the list would just have been too large to paste here. |
That's probably mostly old syntax file from before In general however those changes should come via their respective maintainer (at least give them a chance to see it) before we make changes here. |
For reference, excluding
|
Steps to reproduce
Moving from neovim/neovim#31233
mwe.rst:
and
vim --clean -u vimrc +'set fdm' mwe.rst
wherevimrc
isEverything works as expected. Markdown folding doesn't interfere with rst
folding. However, adding any of these lines
and now rst folding no longer works. I only managed to find php and javascript, but there could be other filetype plugins having the same issue, too.
Expected behaviour
.
Version of Vim
9.1
Environment
Linux
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: