Skip to content

Invalid toggle when caret is after the last or the second-last characters of the selection #1

Description

@wscourge

As listed in the known issues, the current behavior is not ideal.

second-last-bug

The | represents the current caret position.

There are two problems:

  1. Does not work at all when the caret is placed at the end of a string, ie.: "camelCase|"
  2. Does not work when the caret is placed after the second-last string's character, ie.: "camelCa|se" (visible on gif)

It happens due to the string length change - it varies between camelCase and snake_case / kebab-case. Caret's position should update in some smart way.

Acceptance criteria:

  • Toggling works as expected when the caret is placed at the end of the to-be-toggled string: ie.: camelCase|.
  • Toggling works as expected when the caret is placed after the second-last character of the to-be-toggled-string, ie.: camelCas|e.
  • The known issues section of the README.md is removed.

I'm open to any suggestions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions