comparison runtime/doc/repeat.txt @ 14714:bdbb049c2aa8 v8.1.0369

patch 8.1.0369: continuation lines cannot contain comments commit https://github.com/vim/vim/commit/67f8ab829911c7901c534ef2bf19cc34b622936f Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 11 22:37:29 2018 +0200 patch 8.1.0369: continuation lines cannot contain comments Problem: Continuation lines cannot contain comments. Solution: Support using "\ .
author Christian Brabandt <cb@256bit.org>
date Tue, 11 Sep 2018 22:45:07 +0200
parents 2f7e67dd088c
children 40ef13331e02
comparison
equal deleted inserted replaced
14713:5c65d57ca84c 14714:bdbb049c2aa8
463 :1append 463 :1append
464 \asdf 464 \asdf
465 . 465 .
466 :endfunction 466 :endfunction
467 :set cpo-=C 467 :set cpo-=C
468 <
469 *line-continuation-comment*
470 To add a comment in between the lines start with '\" '. Notice the space
471 after the double quote. Example: >
472 let array = [
473 "\ first entry comment
474 \ 'first',
475 "\ second entry comment
476 \ 'second',
477 \ ]
468 478
469 Rationale: 479 Rationale:
470 Most programs work with a trailing backslash to indicate line 480 Most programs work with a trailing backslash to indicate line
471 continuation. Using this in Vim would cause incompatibility with Vi. 481 continuation. Using this in Vim would cause incompatibility with Vi.
472 For example for this Vi mapping: > 482 For example for this Vi mapping: >
473 :map xx asdf\ 483 :map xx asdf\
474 < Therefore the unusual leading backslash is used. 484 < Therefore the unusual leading backslash is used.
485
486 Starting a comment in a continuation line results in all following
487 continuation lines to be part of the comment. Since it was like this
488 for a long time, when making it possible to add a comment halfway a
489 sequence of continuation lines, it was not possible to use \", since
490 that was a valid continuation line. Using '"\ ' comes closest, even
491 though it may look a bit weird. Requiring the space after the
492 backslash is to make it very unlikely this is a normal comment line.
475 493
476 ============================================================================== 494 ==============================================================================
477 5. Using Vim packages *packages* 495 5. Using Vim packages *packages*
478 496
479 A Vim package is a directory that contains one or more plugins. The 497 A Vim package is a directory that contains one or more plugins. The