Skip to content

Improve UX for automatic pair insertion in code snippet block #1827

@pompydev

Description

@pompydev

Have you read a contributing guide?

  • I have read CONTRIBUTING.md
  • I have searched the existing requests and didn't find any that were similar
  • I have considered creating a pull request instead and want to proceed

Clear and concise description of the problem

anytype-ts automatically inserts matching pair in code snippet blocks for certain texts. The feature itself is not problematic but the implementation is not ideal. After a user presses (, the cursor (I) is located at the beginning of the text like so: I() which goes against user's intuition and when a user press ) due to muscle memory, they end up with the following result: )I(). This forces users to develop muscle memory specifically for code snippet blocks in anytype desktop application which is unreasonable.

Suggested solution

Remove this feature. Saving a single character stroke is not worth breaking user expectation for such a niche scenario.

Alternative

Copy vscode's implementation where a matching pair is inserted when a user presses ( but it does not create a duplicate closing parenthesis when a user presses ). This is compatible with most user's intuition.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions