Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: The plugin gets fooled by semantically irrelevant braces #86

Open
pepkin88 opened this issue Oct 20, 2022 · 0 comments
Open

Bug: The plugin gets fooled by semantically irrelevant braces #86

pepkin88 opened this issue Oct 20, 2022 · 0 comments

Comments

@pepkin88
Copy link

pepkin88 commented Oct 20, 2022

The problem

Having a brace character in a string or in a comment breaks the behavior of the plugin.

I don't know, if the problem existed before, but I tested it with Sublime Text 4, Build 4126, on macOS arm64, and the results are following.

Test cases (in JS; the | denotes the cursor position or the start and the end of the selection):

function foo() {
  const obj = {
    bra|ce: '{'
  }
}
function foo() {
  const obj = {
    bra|ce: '' // {
  }
}
function foo() {
  const obj = {
    bra|ce: '}'
  }
}

if you start expanding from the middle of the word brace, after 2 expansions your selection would be this:

function foo() {
  const obj = {
    |brace: '{'
  }|
}
function foo() {
  const obj = {
    |brace: '' // {
  }|
}
function foo() {
  const obj = {
    |brace: '|}'
  }
}

Any following expansions are compounding on the error.

The expected behavior

If you would remove the brace from the string and the comment, the plugin works as intended:
after 2 expansions:

function foo() {
  const obj = {
    |brace: ''|
  }
}

and after 3 expansions:

function foo() {
  const obj = {|
    brace: ''
  |}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant