-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime(vim): make &indentexpr available from the outside
closes: #14936 Signed-off-by: Christian Brabandt <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
@@ -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# | ||
|