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

Better handling of closing delimiters in strict-mode #501

Closed
yuhan0 opened this issue Dec 3, 2019 · 3 comments
Closed

Better handling of closing delimiters in strict-mode #501

yuhan0 opened this issue Dec 3, 2019 · 3 comments

Comments

@yuhan0
Copy link

yuhan0 commented Dec 3, 2019

Current behavior:

  • Type a closing delimiter ), ] or } anywhere except before itself. Alternatively, try inserting the character literal \( which incorrectly triggers an auto-closing )
  • Hitting Backspace to correct the unbalanced delimiter doesn't work as expected, moving cursor across it instead. Requires a force-delete or selection+delete to restore balance.

Expected behavior:

  • Backspace / delete of a delimiter should always be allowed when it is known to be unbalanced (highlighted red)

  • Do not insert unbalanced delimiters so easily in the first place - typing ] etc. should be a no-op or jump the cursor to the nearest closing delimiter.
    An exception could be when there is an unbalanced opening (eg. from partially commented form or pasted text) and the user is trying to manually close it.

@elldritch
Copy link

This is also frustrating with ", where my instinct with "foo" is to type the closing " expecting it to be skipped over (like in most language modes), but instead creating a new unbalanced string.

@PEZ
Copy link
Collaborator

PEZ commented Dec 13, 2019

This build addresses the deletion of unbalanced brackets: https://3366-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.72-fix-delete-unbalanced-501-d089928b.vsix

I like the other suggestion, but would rather have it as a separate issue, in order to not block the bug fix.

@PEZ PEZ closed this as completed in 5cfa878 Dec 15, 2019
@wevre
Copy link

wevre commented Jan 30, 2020

I've also found it unintuitive that typing the second double quote does not break out of the string, but instead adds an extra, unbalanced ".

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

4 participants