mirror of
https://github.com/vim/vim.git
synced 2025-10-15 07:14:09 -04:00
runtime(rst): Update b:undo_ftplugin variable
The value of this variable is evaluated when the 'filetype' option is changed and should be a command string that will undo any configuration changes that the plugin has made. See :help undo_indent for details related: #18566 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Marshall Ward <marshall.ward@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
46d86979a9
commit
5ffb23c967
@@ -4,6 +4,7 @@
|
|||||||
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Original Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
" Website: https://github.com/marshallward/vim-restructuredtext
|
" Website: https://github.com/marshallward/vim-restructuredtext
|
||||||
" Latest Revision: 2020-03-31
|
" Latest Revision: 2020-03-31
|
||||||
|
" 2025 Oct 13 by Vim project: update b:undo_ftplugin #18566
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@@ -18,7 +19,7 @@ if !exists('g:rst_fold_enabled')
|
|||||||
let g:rst_fold_enabled = 0
|
let g:rst_fold_enabled = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl com< cms< et< fo<"
|
let b:undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions<"
|
||||||
|
|
||||||
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
||||||
setlocal formatoptions+=tcroql
|
setlocal formatoptions+=tcroql
|
||||||
@@ -32,15 +33,17 @@ setlocal formatoptions+=tcroql
|
|||||||
|
|
||||||
if exists("g:rst_style") && g:rst_style != 0
|
if exists("g:rst_style") && g:rst_style != 0
|
||||||
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
||||||
|
let b:undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
|
if g:rst_fold_enabled != 0
|
||||||
setlocal foldmethod=expr
|
setlocal foldmethod=expr
|
||||||
setlocal foldexpr=RstFold#GetRstFold()
|
setlocal foldexpr=RstFold#GetRstFold()
|
||||||
setlocal foldtext=RstFold#GetRstFoldText()
|
setlocal foldtext=RstFold#GetRstFoldText()
|
||||||
augroup RstFold
|
augroup RstFold
|
||||||
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
|
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
|
||||||
augroup END
|
augroup END
|
||||||
|
let b:undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
|
Reference in New Issue
Block a user