From b49d695fbc7b93b5e8f3b8deac3118b369d8f7e0 Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Thu, 11 Sep 2025 14:25:09 -0400 Subject: [PATCH] runtime(vim): Update indent script for line continuation with lambda fixes: #18257 closes: #18269 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- runtime/autoload/dist/vimindent.vim | 3 ++- runtime/indent/testdir/vim9.in | 11 +++++++++++ runtime/indent/testdir/vim9.ok | 11 +++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim index ff2f6d8823..79a69e3b53 100644 --- a/runtime/autoload/dist/vimindent.vim +++ b/runtime/autoload/dist/vimindent.vim @@ -2,7 +2,7 @@ vim9script # Language: Vim script # Maintainer: github user lacygoill -# Last Change: 2025 Jul 25 +# Last Change: 2025 Sep 11 # # Includes changes from The Vim Project: @@ -400,6 +400,7 @@ const LINE_CONTINUATION_AT_SOL: string = '^\s*\%(' .. '\|' .. '[#"]\\ ' .. '\|' .. OPERATOR .. '\|' .. '->\s*\h' + .. '\|' .. '->\s*(' # lambda call: ->((v) => v ? "ON" : "OFF")() .. '\|' .. '\.\h' # dict member .. '\|' .. '|' # TODO: `}` at the start of a line is not necessarily a line continuation. diff --git a/runtime/indent/testdir/vim9.in b/runtime/indent/testdir/vim9.in index d4d0399e5e..e0955f1bec 100644 --- a/runtime/indent/testdir/vim9.in +++ b/runtime/indent/testdir/vim9.in @@ -782,3 +782,14 @@ this.value = value enddef endenum # 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 diff --git a/runtime/indent/testdir/vim9.ok b/runtime/indent/testdir/vim9.ok index afad454afe..cc1f7b6594 100644 --- a/runtime/indent/testdir/vim9.ok +++ b/runtime/indent/testdir/vim9.ok @@ -782,3 +782,14 @@ enum Digits enddef endenum # 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