Skip to content

Commit

Permalink
runtime(vim): make &indentexpr available from the outside
Browse files Browse the repository at this point in the history
closes: #14936

Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
chrisbra committed Jul 12, 2024
1 parent 5247b0b commit cb79288
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/indent/vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>

# Only load this indent file when no other was loaded.
Expand All @@ -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#
Expand Down

0 comments on commit cb79288

Please sign in to comment.