runtime(vim): make &indentexpr available from the outside Commit: https://github.com/vim/vim/commit/cb7928812e0dffac2750c9b0513915e17dfa116f Author: Christian Brabandt <c...@256bit.org> Date: Fri Jul 12 20:02:31 2024 +0200
runtime(vim): make &indentexpr available from the outside closes: https://github.com/vim/vim/issues/14936 Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim index 97a4a3662..c95a76dd4 100644 --- a/runtime/indent/vim.vim +++ b/runtime/indent/vim.vim @@ -3,7 +3,7 @@ vim9script # Vim indent file # Language: Vim script # Maintainer: The Vim Project <https://github.com/vim/vim> -# Last Change: 2023 Aug 10 +# Last Change: 2024 Jul 12 # Former Maintainer: Bram Moolenaar <b...@vim.org> # Only load this indent file when no other was loaded. @@ -16,7 +16,9 @@ b:undo_indent = 'setlocal indentkeys< indentexpr<' import autoload '../autoload/dist/vimindent.vim' -setlocal indentexpr=vimindent.Expr() +# export indentexpr as a global function, so it can be easily manipulated by plugins +g:VimIndent = vimindent.Expr +setlocal indentexpr=g:VimIndent() setlocal indentkeys+==endif,=enddef,=endfu,=endfor,=endwh,=endtry,=endclass,=endinterface,=endenum,=},=else,=cat,=finall,=END,0\ execute('setlocal indentkeys+=0=\"\\ ,0=#\\ ') setlocal indentkeys-=0# -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/E1sSKnP-002T1H-9Y%40256bit.org.