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

Add Ctrl+/ as a shortcut to toggle comment in addition to Ctrl+K #79610

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

aaronfranke
Copy link
Member

I am stuck in an infinite loop of habits: Try to press Ctrl+/ in Godot, doesn't work, press Ctrl+K instead, get used to Ctrl+K, switch to VS Code, try to press Ctrl+K, doesn't work, press Ctrl+/ instead, get used to Ctrl+/, switch to Godot, try to press Ctrl+/ in Godot, doesn't work, press Ctrl+K instead...

Considering GDScript uses # as the comment symbol, I think Komment makes more sense than Ctrl+/ conceptually speaking, but we can add Ctrl+/ as an additional shortcut for users with VS Code muscle memory. Since Ctrl+K is at the start of the shortcut array, the keyboard shortcut text in the menu is still Ctrl+K.

@aaronfranke aaronfranke added this to the 4.x milestone Jul 18, 2023
@aaronfranke aaronfranke requested a review from a team as a code owner July 18, 2023 12:08
@YuriSizov
Copy link
Contributor

YuriSizov commented Jul 18, 2023

I don't see a strong argument for changing this, even as an addition, for everyone when you can configure it on your end however you want. Godot supports having multiple shortcuts per actions, so you can keep both by changing your editor settings.

See also godotengine/godot-proposals#3822.

@coppolaemilio
Copy link
Member

I did a twitter poll and the results were favorable to this change:
https://twitter.com/emi_cpl/status/1681281437436203008
image

Most people already know the shortcut from using other popular script editors, and the ones who don't it's mostly because of their keyboard layouts, so keeping both seems like a great idea.

Since we already use many of the other popular shortcuts I think it is good to include this one as well.

Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a reasonable change. Most editors use that by default, and it's always good to match the user's expectations on simple things like this.

@YuriSizov
Copy link
Contributor

I did a twitter poll and the results were favorable to this change:

Just to repeat myself from RC, this wasn't a very useful poll because we don't discuss replacing K with /. We are discussing this as an addition. So what we'd want to ensure is that / is actually a more popular alternative than other alternatives. From the responds to the linked proposal and to your poll it's not that clear, and many developers use a wide variety of shortcuts, either their own or defaults from other code editors.

So TIWAGOS the results of this poll.

@coppolaemilio
Copy link
Member

@YuriSizov I get what you are saying, but not sure why you are saying it. Both options are clearly popular and there doesn't seem to be a downside in having both. If it was overwhelmingly one sided it would have changed my perception of the proposed change, but being that there are reasons to have both, and that people are happy with Ctrl+/ I think we should merge this one.

@YuriSizov
Copy link
Contributor

YuriSizov commented Jul 19, 2023

@coppolaemilio It doesn't look like you get what I'm saying 🙃 I'm pointing out that your poll was about choosing between Ctrl-K and Ctrl-/, but this PR doesn't pit them against each other. We are not discussing replacing Ctrl-K with Ctrl-/. We are discussing adding a second shortcut to go alongside the existing one.

The question in the poll should be "If we are going to add a second one, which one should we add" with Ctrl-/ being one of the options and Ctrl-K not present at all. Because based on the answers in the proposal and on replies to your tweet, many people prefer different alternative shortcuts, not necessarily Ctrl-/.

Edit: Simply put, yes, your poll shows that people would be happy with Ctrl-/, but it doesn't show that they won't be equally happy with some other alternative, like Ctrl-3 or whatever else people suggested.

Edit 2: And I'm not saying we shouldn't merge this. Just that the data you've collected is not representative of community opinions and should be taken with a grain of salt.

@Calinou
Copy link
Member

Calinou commented Jul 19, 2023

Since we aren't using Ctrl + / for anything right now, I don't see a problem with giving it a default binding. Unused keys are wasted keys 😶

@YuriSizov YuriSizov modified the milestones: 4.x, 4.2 Jul 25, 2023
@YuriSizov YuriSizov merged commit 25f3f66 into godotengine:master Jul 31, 2023
13 checks passed
@Zireael07
Copy link
Contributor

Yay, I have the same problem as OP here :P

@YuriSizov
Copy link
Contributor

Thanks!

@aaronfranke aaronfranke deleted the toggle-comment-slash branch July 31, 2023 19:19
@ghmart
Copy link

ghmart commented Aug 12, 2023

Shouldn't this shortcut be Ctrl + KP-Divide instead of Ctrl + /?
It's easier to find and closer to the right hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants