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

Self closing characters logic #92

Closed
angezid opened this issue Mar 20, 2023 · 4 comments
Closed

Self closing characters logic #92

angezid opened this issue Mar 20, 2023 · 4 comments

Comments

@angezid
Copy link

angezid commented Mar 20, 2023

  1. When typing a single or double quote before the same quote, it just moves the cursor one position forward instead of typing a quote.
    Between the characters and at the end of the word, it generates two quotes, although by logic it shouldn't.

  2. When typing open bracket before any bracket, it doesn't add a close bracket. Why it is forbidden in (..()), {..{}}, [..[]], {..()}, [..{}], (..[])?
    If the cursor is before close bracket, it's most likely that the cursor is inside brackets and close bracket should be added, e.g. if (ab()),{ab : {}}, [.., []].

  3. When trying to enclose a selection in brackets there is some strange logic, it encloses the selection only on some conditions.
    In other cases, it just replaces selection by open bracket.
    Also, it allows only one enclosure of selection in quotes. But what about triple-quoted strings that some languages have?
    If the option is addClosing: true, there should be only one condition - non-empty selection.

@antonmedv
Copy link
Owner

Actually, I think to drop all this logic altogether. It's strange and only hinders devs.

@angezid
Copy link
Author

angezid commented Mar 21, 2023

The problem is not the feature itself, but implementation.
I fixed it for my project, from my point of view, it is satisfactory for C-like languages.
If you interested, take look at https://github.com/angezid/codejar/tree/self-closing-characters.

@antonmedv
Copy link
Owner

Cool. Maybe a PR?

@antonmedv
Copy link
Owner

I dropped most of this logic. So now it should behave more naturally.

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

Successfully merging a pull request may close this issue.

2 participants