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:
Maxim Kim
2025-09-11 14:25:09 -04:00
committed by Christian Brabandt
parent 15070eee2f
commit b49d695fbc
3 changed files with 24 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -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