Skip to content

Turn off all auto-insertion/leaving when not perfectly balanced. #64

@jordwalke

Description

@jordwalke

I notice that the times when these types of plugins surprise you, is when the source code was not perfectly balanced, and you try to correct that imbalance, yet the plugin fights your attempts. Example:
* represents the cursor.

`myMethod*).call()`

In this case I want to type ( to complete the function call but smartinput inserts an extra opening paren. I think the best strategy is to disable any actions the plugin would ever take when the code is not already balanced. Or better yet, never insert a matching pair if the users keypress would cause the source to become balanced. That's a good way to tell that your plugin's efforts will fight against the users' attempts to make the source code balanced.

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