Skip to content

syntax errors with line wrapping #24

Description

@dseomn

With this text and textwidth set to 80:

foo = dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + sd

Typing another letter results in:

foo = dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf + dfgdfgdgf +
sdf

Which is a SyntaxError.

I think a simple fix would be to add this:

setlocal formatoptions-=t

Maybe there's some way to detect if there are unclosed parentheses or other syntax that would allow line wrapping, and only wrap if it wouldn't be a SyntaxError? Not sure it's worth the additional complication though, even if that is possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions