runtime(vim): Update indent script for line continuation with lambda Commit: https://github.com/vim/vim/commit/b49d695fbc7b93b5e8f3b8deac3118b369d8f7e0 Author: Maxim Kim <haba...@gmail.com> Date: Thu Sep 11 14:25:09 2025 -0400
runtime(vim): Update indent script for line continuation with lambda fixes: https://github.com/vim/vim/issues/18257 closes: https://github.com/vim/vim/issues/18269 Signed-off-by: Maxim Kim <haba...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim index ff2f6d882..79a69e3b5 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 d4d0399e5..e0955f1be 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 afad454af..cc1f7b659 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 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uwm3X-000TkM-IO%40256bit.org.