3

There are times I want to comment List items:

let test_data = [
      \ " description in comment
      \ complicated_data0
      \
      \ " description in comment
      \ complicated_data1
      ...
      \ ]

----
result error:

E114: Missing quote: " description in comment 0 ]

E114 is thrown as it's missing the enclosing".

What's the common workaround ?

1 Answer 1

5

Since patch 8.1.0369 you can comment continuation lines. However, you must follow the "\ syntax:

let test_data = [
      "\ description in comment
      \ complicated_data0
      \
      "\ description in comment
      \ complicated_data1
      ...
      \ ]

Prior to that, you would need to split the list up into pieces:

" description in comment
let test_data = [
      \ 1,
      \ ]
" description in comment",
let test_data += [
      \ 2,
      \ ]
1
  • 1
    Thanks, both works. There is a typo in first line, it's "\ , not \".
    – dedowsdi
    Commented Nov 18, 2019 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.