Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

Feature request: support for wrapping multiline strings

Open maraino opened this issue 7 years ago • 3 comments

Some languages like Go supports multiline strings, in Go, these strings are like:

s := `This is a formatted multiline string.

They are also called raw-strings. They support
	 tabs and do not \escape characters\n`

Right now, you can fool rewrap if you add /* at the beginning of the string, rewrap thinks that this is a comment and allow you to wrap the strings to 80 characters. It would be good to add support by default to this kind of strings as they are generally used to write formatted data.

maraino avatar Nov 01 '18 19:11 maraino

Another option to support this case and others would be to force the rewrap of the selected block of lines. Other buggy extensions like wrap support this.

maraino avatar Nov 01 '18 19:11 maraino

Intriguingly in Python there's already support for triple-quoted strings which are docstrings, but not for stand-alone triple-quoted strings:


def func():
    """
    words words words words words words.
    """

    value = """
    words words words words words words.
    """

PeterJCLaw avatar Jun 06 '20 15:06 PeterJCLaw

+1

Maybe with a different shortcut but it would be nice if we could rewrap any string.

lud-wj avatar Jun 05 '25 13:06 lud-wj