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

[CLOSED] Improvement: remove brackets/quotes in the same way as add #6788

Open
core-ai-bot opened this issue Aug 30, 2021 · 4 comments
Open

Comments

@core-ai-bot
Copy link
Member

Issue by dvorapa
Wednesday Apr 16, 2014 at 16:05 GMT
Originally opened as adobe/brackets#7540


If I select the piece of code and hit some bracket on my keyboard, the selected code become wrapped with the type of the bracket I hit. If I select this piece of code (both with and without brackets) and hit the same bracket as the wrapping, there are added another brackets. But I think, that better behavior would be, if the brackets are removed after selecting it and hitting the corresponding type of the bracket.

And if you implement it, please don't forget to do the same thing also for quotes...

Against causing confusion: If the user selects the text with brackets at the beginning and ending of the selected text and hit the same bracket key, the brackets would be removed. If the user selects only the code inside brackets or the code, inside which are the brackets, the code would become wrapped as usual.

I think, it is really useful improvement :-)

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Apr 16, 2014 at 21:05 GMT


This seems related to (and possibly contradicts) the discussion in issue #5778, which is about auto-inserted quotes

@core-ai-bot
Copy link
Member Author

Comment by dvorapa
Wednesday Apr 16, 2014 at 21:55 GMT


But in the different way (if I understand #5778 correctly). Better example: there is a piece of code between quotes like this:

blah "somepieceofmycode" bleh

and it is selected (with quotes). Then I press the " key on my keyboard and the final code looks like this:

blah somepieceofmycode bleh

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Apr 17, 2014 at 02:45 GMT


@dvorapa Yes, that's in conflict to #5778, where the ask would be for the quotes to be retained -- so you could select the whole range and type "foo" to replace it with that text. With the behavior you're proposing, typing "foo" would yield blah foo" bleh in the editor.

This sounds like something we may need to have a preference for if the two diverging expectations are both fairly common. @dvorapa Are there other editors that behave the way that's described here? (Or popular editor extensions that add this behavior?)

@core-ai-bot
Copy link
Member Author

Comment by njx
Monday Apr 21, 2014 at 18:30 GMT


Reviewed. We talked about it and it doesn't seem intuitive to us that typing a character should remove content. Also, looking at a handful of other editors, it seems like they just continue to add quotes rather than removing them.

Closing - if you can find a number of other editors that have this behavior we might reconsider.

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