2

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 ?

4

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,
      \ ]
| improve this answer | |
  • 1
    Thanks, both works. There is a typo in first line, it's "\ , not \". – dedowsdi Nov 18 '19 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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