view runtime/syntax/testdir/input/vim_line_continuation.vim @ 34227:60e1e94a1b0e

runtime(vim): Update syntax and ftplugin files (#13924) Commit: https://github.com/vim/vim/commit/21ce159e05615fd139c564b734a4bffc9f3fdc4b Author: dkearns <dougkearns@gmail.com> Date: Mon Jan 29 04:54:08 2024 +1100 runtime(vim): Update syntax and ftplugin files (https://github.com/vim/vim/issues/13924) Improve matching of line-continuations and interspersed comments. These are now also matched in multiline syntax command patterns, dictionary literals, and parenthesised expressions and argument lists. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 28 Jan 2024 19:00:08 +0100
parents
children
line wrap: on
line source

" Vim line continuations with interspersed comments

function Foo(
      "\ param a
      \ a,
      "\ param b
      \ b,
      "\ param c
      \ c
      \)
  echomsg
	"\ start string
	\ $"
	"\ print a
	\ a = {a:a},
	"\ print b
	\ b = {a:b},
	"\ print c
	\ c = {a:c}
	"\ end string
	\"
endfunction

call Foo(
      "\ arg 1
      \ 11,
      "\ arg 2
      \ 22,
      "\ arg 3
      \ 33
      \)

let dict = #{
      "\ pair 1
      \ a: 1,
      "\ pair 2
      \ b: 2,
      "\ pair 3
      \ c: 3
      \}

let array = [
      "\ element 1
      \ 1,
      "\ element 2
      \ 2,
      "\ element 3
      \ 3
      \]