Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding new flags to :let-heredoc breaks compatibility #4705

@tyru

Description

@tyru

Problem

This is a normal heredoc example.

let text =<< trim END
  if ok
    echo 'done'
  endif
END

If we wants new flags like eol other than trim,
the existing code like below will not work.

" eol is not flag!
let text =<< trim eol
  if ok
    echo 'done'
  endif
eol

Or some useful flags if available

Solution

  • Make flags is lowercase letters only
  • Make marker is uppercase letters only (if omitted, "." is used)

It gets rid of ambiguity from :let-heredoc, and guarantees forward compatibility.


And, if possible, I would like marker to be required parameter.
Currently "." is used if omitted, but it may confuse users? 🤔

" oops! "END" is missing
let text =<< trim
  if ok
    echo 'done'
  endif
END

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions