Skip to content

Paredit enclose in parenthesis issue when extra spaces are present #835

@noncom

Description

@noncom

When I have the following selection in the editor: |(form)| and I press (, then paredit correctly transforms it into ((form)). However, if there are extra spaces included in the selection on either side of the form, then paredit simply does nothing when I press (:

| (form)| --> press ( --> (form) incorrect
|(form) | --> press ( --> (form) incorrect
| (form) | --> press ( --> (form) incorrect
|(form)| --> press ( --> ((form)) correct

The number of spaces can be any (github markdown restricts it to 1 space, but that would be same for any number of spaces). It would probably be the same even for tabs, but, interestingly, not for new lines.

Doing this operation with new-lines puts the parenthesis exactly in the places where selection had its start and end, preserving all the new lines and everything. I wonder if this should be the case with spaces too - preserve the spaces, or not... obviously, preserving more than 1 space is superfluous since there can be justification for preserving 1 space, but not more of them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions