Rewrap
Rewrap copied to clipboard
Feature request: support for wrapping multiline strings
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.
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.
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.
"""
+1
Maybe with a different shortcut but it would be nice if we could rewrap any string.