diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2019-10-12 09:48:48 +0200 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2019-10-13 00:03:27 +0200 |
commit | 6c012b0624935b93e92a0b12d86d49ef695210ba (patch) | |
tree | 130a76cb21add8fc2a175ac318eb5d598ca783b5 /runtime | |
parent | 9af0fe529d2d91640e4d3388ab9f28159553f14c (diff) | |
download | rneovim-6c012b0624935b93e92a0b12d86d49ef695210ba.tar.gz rneovim-6c012b0624935b93e92a0b12d86d49ef695210ba.tar.bz2 rneovim-6c012b0624935b93e92a0b12d86d49ef695210ba.zip |
vim-patch:8.1.1585: :let-heredoc does not trim enough
Problem: :let-heredoc does not trim enough.
Solution: Trim indent from the contents based on the indent of the first
line. Use let-heredoc in more tests.
https://github.com/vim/vim/commit/e7eb92708ec2092a2fc11e78703b5dcf83844412
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/eval.txt | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 607e88b7c8..8cdaef007c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -9793,13 +9793,24 @@ text... If {marker} is not supplied, then "." is used as the default marker. - Any white space characters in the lines of text are - preserved. If "trim" is specified before {marker}, - then all the leading indentation exactly matching the - leading indentation before `let` is stripped from the - input lines and the line containing {marker}. Note - that the difference between space and tab matters - here. + Without "trim" any white space characters in the lines + of text are preserved. If "trim" is specified before + {marker}, then indentation is stripped so you can do: > + let text =<< trim END + if ok + echo 'done' + endif + END +< Results in: ["if ok", " echo 'done'", "endif"] + The marker must line up with "let" and the indentation + of the first line is removed from all the text lines. + Specifically: all the leading indentation exactly + matching the leading indentation of the first + non-empty text line is stripped from the input lines. + All leading indentation exactly matching the leading + indentation before `let` is stripped from the line + containing {marker}. Note that the difference between + space and tab matters here. If {var-name} didn't exist yet, it is created. Cannot be followed by another command, but can be |