Skip to content

Add support for here document in :let statement#4386

Closed
yegappan wants to merge 5 commits intovim:masterfrom
yegappan:heredoc
Closed

Add support for here document in :let statement#4386
yegappan wants to merge 5 commits intovim:masterfrom
yegappan:heredoc

Conversation

@yegappan
Copy link
Member

No description provided.

@codecov-io
Copy link

codecov-io commented May 18, 2019

Codecov Report

Merging #4386 into master will increase coverage by <.01%.
The diff coverage is 70.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4386      +/-   ##
==========================================
+ Coverage   80.36%   80.37%   +<.01%     
==========================================
  Files         109      109              
  Lines      142611   142659      +48     
==========================================
+ Hits       114616   114659      +43     
- Misses      27995    28000       +5
Impacted Files Coverage Δ
src/eval.c 85.82% <70.83%> (-0.16%) ⬇️
src/if_xcmdsrv.c 84.02% <0%> (-0.18%) ⬇️
src/window.c 86.48% <0%> (-0.1%) ⬇️
src/screen.c 81.54% <0%> (-0.05%) ⬇️
src/terminal.c 80.7% <0%> (+0.03%) ⬆️
src/term.c 73.53% <0%> (+0.05%) ⬆️
src/ui.c 55.67% <0%> (+0.07%) ⬆️
src/gui.c 57.94% <0%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc6855a...a1bd40b. Read the comment docs.

@chdiza
Copy link

chdiza commented May 18, 2019

What is this for? We can already do e.g. :let foo="oof\nbar\tbaz", right?

In particular I see no need for the stripping aspect. When using :let inside a script we can also already use line continuation. So just do

let foo="one
    \two
    \three
\four"

@vim-ml
Copy link

vim-ml commented May 18, 2019 via email

@Houl
Copy link
Contributor

Houl commented May 18, 2019

What about making {marker} optional and use . per default (a single dot on its own line)? This is expected from :i, :a etc.

@brammool brammool closed this in f5842c5 May 19, 2019
@ichizok
Copy link
Contributor

ichizok commented May 19, 2019

There are some patterns cannot work: e.g. a line starts with endfunc append python...

func Foo()
  let x =<<
endfunc
.
endfunc

E193: :endfunction not inside a function

func Foo()
  let x =<<END
a
END
endfunc

E126: Missing :endfunction

func Foo()
  let x =<<END
python <<EOS
END
endfunc

E126: Missing :endfunction

@vim-ml
Copy link

vim-ml commented May 19, 2019 via email

@Houl
Copy link
Contributor

Houl commented May 19, 2019

Btw, when I need some heredoc data, I put a finish line in the code, followed by a data section in heredoc notation which is later at "runtime" extracted with a bit of Vimscript into a dict.

@vim-ml
Copy link

vim-ml commented May 19, 2019 via email

@vim-ml
Copy link

vim-ml commented May 19, 2019 via email

manuelschiller pushed a commit to manuelschiller/vim that referenced this pull request Nov 10, 2019
Problem:    Getting a list of text lines is clumsy.
Solution:   Add the =<< assignment. (Yegappan Lakshmanan, closes vim#4386)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants