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] Adding support for delete entire line/lines #1718

Open
core-ai-bot opened this issue Aug 29, 2021 · 14 comments
Open

[CLOSED] Adding support for delete entire line/lines #1718

core-ai-bot opened this issue Aug 29, 2021 · 14 comments

Comments

@core-ai-bot
Copy link
Member

Issue by mcorlan
Thursday Oct 04, 2012 at 00:11 GMT
Originally opened as adobe/brackets#1763


Hitting Ctrl+Y will delete the line where the cursor is or the lines for the current selection including the end of line.


mcorlan included the following code: https://github.com/adobe/brackets/pull/1763/commits

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Oct 04, 2012 at 03:26 GMT


This works great! My only concern is that Ctrl-Y is already used on Windows as Redo. Shift-Ctrl-Z also works as Redo on Windows, so maybe it's ok. I'll ask the rest of the core team what they think. Is there another short-cut you could use? Worst case is that this may need to be converted to an extension.

@core-ai-bot
Copy link
Member Author

Comment by mcorlan
Thursday Oct 04, 2012 at 05:48 GMT


Yeah, I agree is not the best the shortcut. I would gladly use any shortcut you guys want.

@core-ai-bot
Copy link
Member Author

Comment by DennisKehrig
Thursday Oct 04, 2012 at 06:52 GMT


I vote Ctrl-Shift-L, because SciTE uses it. :)
Ctrl-Shift-D also makes sense to me. Ctrl-D could duplicate a line, Ctrl-Shift-D would in some sense be the inverse of that.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Oct 04, 2012 at 18:07 GMT


Supposedly this also conflicts with a shortcut on Mac, also. I am not sure how to determine what's the best shortcut to use, but I think this will be best if this is converted to an extension. That way, anyone can pick and choose which commands they want to load. Here are some resources that may help:

https://github.com/adobe/brackets/wiki/How%20to%20write%20extensions
https://github.com/davidderaedt/Brackets-extension-toolkit

@core-ai-bot
Copy link
Member Author

Comment by mcorlan
Thursday Oct 04, 2012 at 18:30 GMT


Are you sure guys that a feature like this should be an extension? To me is just as important as Copy/Paste and so forth :). I would expect to just be there.

I know the shortcut is not easy to figure out. The ones used by Eclipse or Idea for the same feature are already used by Brackets for something different.

Are you guys happy with "Ctrl-Shift-D"?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Oct 04, 2012 at 18:53 GMT


As much as I appreciate you contributing to Brackets, this is not a feature that I, personally, use. I would rather select the lines and hit delete. That way I know exactly what is being deleted, I don't have to remember another shortcut, and the editor code is slightly smaller. The more commands taht are implemented as extensions, the more choice everyone has to customize their editor.

Another part of the problem is that there are just not enough shortcuts for every feature. We really need to start a wiki page with a table of all the shortcuts so we can easily see what we have in both core and extensions.

You are welcome to start a discussion in the brackets-dev forum (https://groups.google.com/forum/?fromgroups#!forum/brackets-dev) to see if you can get a consensus. Most of the core brackets team is in Europe for the Create the Web tour, and won't be back for a week, so I won't be able to poll everyone for awhile, anyway.

@core-ai-bot
Copy link
Member Author

Comment by GarthDB
Thursday Oct 04, 2012 at 19:40 GMT


I think I would use it, and it as useful as duplicate line.

Garth Braithwaite
Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, October 4, 2012 at 11:53 AM, Randy Edmunds wrote:

As much as I appreciate you contributing to Brackets, this is not a feature that I, personally, use. I would rather select the lines and hit delete. That way I know exactly what is being deleted, I don't have to remember another shortcut, and the editor code is slightly smaller. The more commands taht are implemented as extensions, the more choice everyone has to customize their editor.
Another part of the problem is that there are just not enough shortcuts for every feature. We really need to start a wiki page with a table of all the shortcuts so we can easily see what we have in both core and extensions.
You are welcome to start a discussion in the brackets-dev forum (https://groups.google.com/forum/?fromgroups#!forum/brackets-dev) to see if you can get a consensus. Most of the core brackets team is in Europe for the Create the Web tour, and won't be back for a week, so I won't be able to poll everyone for awhile, anyway.


Reply to this email directly or view it on GitHub (adobe/brackets#1763 (comment)).

@core-ai-bot
Copy link
Member Author

Comment by mcorlan
Thursday Oct 04, 2012 at 20:20 GMT


@redmunds

Forcing this feature on you as a core feature was not my intention at all. If this is how it came across I apologize. I used my personal experience as a starting point for a healthy debate. Ultimately I am not the one to decide. You guys have the last word.

Having said that I don't believe that we should be afraid that we end up with too many shortcuts. If this would be true for the vast majority of programers then I am afraid that VIM would have been gone long time ago. VIM is completely useless without shortcuts. I guess people will use those shortcuts that make sense to them and ignore the others. What are those useful or not it is hard to say without doing a statistical research among your product users.

I was thinking today about the shortcuts discoverability problem. You are right we should do something about. Ideally I think we should have an API to declare shortcuts in such a way that a "live" list with all the available shortcuts (from core features or extensions) is generated at runtime and makes easy for developers to see what is available. This would be the first step, the second one would be to let them change the shortcuts.

Thank you for taking your time to review my pull request and expressing your concerns. I think in the end we all want to get the best of the best possible code editor :)

@core-ai-bot
Copy link
Member Author

Comment by DennisKehrig
Friday Oct 05, 2012 at 12:05 GMT


I use it all the time, too. It works regardless of where the cursor is in that line and whether anything is selected or not, while all first-select-then-delete based methods are just that extra bit more involved.

I think in the long run we need a keyboard shortcut manager. Not having conflicting shortcuts is one thing, but some shortcuts don't make sense on a German keyboard, for instance. While "[" is a single key stroke on an English keyboard, it's AltGr-[ (Ctrl-Alt-[) on a German one, so a shortcut like Ctrl-[ doesn't really make a lot of sense on a German keyboard.

In the meantime a Wiki page like@redmunds suggests would definitely be useful, I think there's one extension out there that uses Ctrl-Shift-E - just like the extension manager. That should be avoided.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Wednesday Oct 10, 2012 at 20:35 GMT


MIhai,

The team wants to pull this into the core code. Shortcut "Ctrl-Shift-D" is available and should be ok.

In addition to having a shortcut key, it should be in the Edit menu so that it's discoverable. I didn't notice before, but the shortcut should not be added to the codeMirrorKeyMap. You can assign the shortcut at the same time you add the menu item. Take a look in Menu.js.

Thanks,
Randy

@core-ai-bot
Copy link
Member Author

Comment by mcorlan
Thursday Oct 11, 2012 at 10:35 GMT


Hey Randy,

I changed the code accordingly to your suggestions. I hope it is OK the way I exposed/register to the menu.

Thanks for your patience!

cheers,
Mihai

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Oct 11, 2012 at 22:30 GMT


@mcorlan,

This looks good. The last thing you need to do is the accept the Contributor's License Agreement: http://dev.brackets.io/brackets-contributor-license-agreement.html. Let me know when that's done.

Thanks,
Randy

@core-ai-bot
Copy link
Member Author

Comment by mcorlan
Friday Oct 12, 2012 at 06:09 GMT


Done :)

Thanks Randy! It feels awesome to finally land a piece of code/functionality!

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Friday Oct 12, 2012 at 15:12 GMT


Looks good. Merging. Welcome to the club, Mihai! Thank you for your contribution.

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