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

Toggle Line Comments #34

Closed
amay5267 opened this issue Oct 8, 2022 · 5 comments
Closed

Toggle Line Comments #34

amay5267 opened this issue Oct 8, 2022 · 5 comments

Comments

@amay5267
Copy link

amay5267 commented Oct 8, 2022

hi @magiblot

Can we toggle line comments with CTRL-/ shortcut?

@magiblot
Copy link
Owner

magiblot commented Oct 8, 2022

Hi @amay5267!

I may be able to add this, although it will certainly need a shortcut other than Ctrl+/ (since most Unix terminals don't support it).

What programming language do you need comments for?

@amay5267
Copy link
Author

amay5267 commented Oct 9, 2022

OK. C, CPP, Python.
I need
CPP single line comments
// cpp comment
Python
python # comment
And single and multi line comments in C.
/* C
you later */

magiblot added a commit that referenced this issue Oct 15, 2022
magiblot added a commit that referenced this issue Oct 15, 2022
@magiblot
Copy link
Owner

This has been implemented this in 395c02f. The shortcut is Ctrl+Q, as in SciTE, but the behaviour is like in Kate. That is, it automatically chooses between line or block comments depending on the text selection:

  • No selection: line comments (//)
  • Whole lines selected: line comments (//)
  • Selection beginning and/or ending in the middle of a line: block comments (/* */)

If the language supports just one kind of comment, then that's the one that is always used.

@amay5267
Copy link
Author

Works like a charm!

@magiblot
Copy link
Owner

I had to change the shortcut for Toggle Comment to Ctrl+E because of #58. However, Ctrl+/ might also work.

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

2 participants