diff 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
line wrap: on
line diff
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -465,6 +465,16 @@ flag when defining the function, it is n
    .
    :endfunction
    :set cpo-=C
+<
+					*line-continuation-comment*
+To add a comment in between the lines start with '\" '.  Notice the space
+after the double quote.  Example: >
+	let array = [
+		"\ first entry comment
+		\ 'first',
+		"\ second entry comment
+		\ 'second',
+		\ ]
 
 Rationale:
 	Most programs work with a trailing backslash to indicate line
@@ -473,6 +483,14 @@ Rationale:
 		:map xx  asdf\
 <	Therefore the unusual leading backslash is used.
 
+	Starting a comment in a continuation line results in all following
+	continuation lines to be part of the comment.  Since it was like this
+	for a long time, when making it possible to add a comment halfway a
+	sequence of continuation lines, it was not possible to use \", since
+	that was a valid continuation line.  Using '"\ ' comes closest, even
+	though it may look a bit weird.  Requiring the space after the
+	backslash is to make it very unlikely this is a normal comment line.
+
 ==============================================================================
 5. Using Vim packages					*packages*