Yegappan wrote:
> > > When converting test29 into a new style test, I came across several > > > instances where multiple lines of text need to be stored in a variable. > > > I used the following method to do it: > > > > > > new > > > insert > > > some text > > > some text > > > some text > > > . > > > > > > let text = getline(1, '$') > > > > > > You can also use a list literal to store the lines. But it is not > > > readable. > > > > > > It will be useful to support a HERE document syntax for assigning multiple > > > lines of text to a variable. Something along the lines of (similar to the > > > shell > > > here document syntax): > > > > > > let text <<HERE > > > some text > > > some text > > > HERE > > > > Yeah, the list syntax is OK, but when the text contains quotes it gets a > > bit messy. > > > > We already use this for Python, Lua, etc. > > > > I have created the PR #4386 that implements the support for this. > > https://github.com/vim/vim/pull/4386 Thanks! I'm not sure why you added the feature to trim tabs. Why not all white space? I suppose it's for things like this: func GetColors() let colors =<< END blue red green END return colors endfunc This looks better: func GetColors() let colors =<< trim END blue red green END return colors endfunc The "-" is cryptic, is this coming from another language? I would prefer something easily understandable, like "trim". I would think that when "trim" is used, then the indent of the first line is removed, and the same amount is removed from following lines. And the marker must have less indent. This allows for: func GetNested() let nested =<< trim END header1 item1 item2 header2 item3 END return nested endfunc Then three space of indent before the item lines is preserved. -- "You're fired." (1980) "You're laid off." (1985) "You're downsized." (1990) "You're rightsized." (1992) (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201905181105.x4IB5jCM028242%40masaka.moolenaar.net. For more options, visit https://groups.google.com/d/optout.
