runtime(vim): Update indent script for line continuation with lambda
fixes: #18257 closes: #18269 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
15070eee2f
commit
b49d695fbc
3
runtime/autoload/dist/vimindent.vim
vendored
3
runtime/autoload/dist/vimindent.vim
vendored
@ -2,7 +2,7 @@ vim9script
|
|||||||
|
|
||||||
# Language: Vim script
|
# Language: Vim script
|
||||||
# Maintainer: github user lacygoill
|
# Maintainer: github user lacygoill
|
||||||
# Last Change: 2025 Jul 25
|
# Last Change: 2025 Sep 11
|
||||||
#
|
#
|
||||||
# Includes changes from The Vim Project:
|
# Includes changes from The Vim Project:
|
||||||
|
|
||||||
@ -400,6 +400,7 @@ const LINE_CONTINUATION_AT_SOL: string = '^\s*\%('
|
|||||||
.. '\|' .. '[#"]\\ '
|
.. '\|' .. '[#"]\\ '
|
||||||
.. '\|' .. OPERATOR
|
.. '\|' .. OPERATOR
|
||||||
.. '\|' .. '->\s*\h'
|
.. '\|' .. '->\s*\h'
|
||||||
|
.. '\|' .. '->\s*(' # lambda call: ->((v) => v ? "ON" : "OFF")()
|
||||||
.. '\|' .. '\.\h' # dict member
|
.. '\|' .. '\.\h' # dict member
|
||||||
.. '\|' .. '|'
|
.. '\|' .. '|'
|
||||||
# TODO: `}` at the start of a line is not necessarily a line continuation.
|
# TODO: `}` at the start of a line is not necessarily a line continuation.
|
||||||
|
|||||||
@ -782,3 +782,14 @@ this.value = value
|
|||||||
enddef
|
enddef
|
||||||
endenum
|
endenum
|
||||||
# END_INDENT
|
# END_INDENT
|
||||||
|
|
||||||
|
# START_INDENT
|
||||||
|
def ToggleBoolOpt(opt: string)
|
||||||
|
exe $"&{opt} = !&{opt}"
|
||||||
|
$"&{opt}"
|
||||||
|
->eval()
|
||||||
|
->( (v) => v ? "ON" : "OFF" )()
|
||||||
|
->printf($"{opt} %s")
|
||||||
|
->popup_notification({})
|
||||||
|
enddef
|
||||||
|
# END_INDENT
|
||||||
|
|||||||
@ -782,3 +782,14 @@ enum Digits
|
|||||||
enddef
|
enddef
|
||||||
endenum
|
endenum
|
||||||
# END_INDENT
|
# END_INDENT
|
||||||
|
|
||||||
|
# START_INDENT
|
||||||
|
def ToggleBoolOpt(opt: string)
|
||||||
|
exe $"&{opt} = !&{opt}"
|
||||||
|
$"&{opt}"
|
||||||
|
->eval()
|
||||||
|
->( (v) => v ? "ON" : "OFF" )()
|
||||||
|
->printf($"{opt} %s")
|
||||||
|
->popup_notification({})
|
||||||
|
enddef
|
||||||
|
# END_INDENT
|
||||||
|
|||||||
Reference in New Issue
Block a user