Can't comment text in KWrite

Doesn’t work “Ctrl+D” to comment text in the Kwrite application. I can’t find any information about this issue. Am I the only one having this problem?

Works fine here. (13.2, KDE 4.14.2)

What version of KWrite are you using?
Is the shortcut Ctrl+D assigned correctly?

Did you actually select the correct syntax highlighting? (Extras->Highlighting)
This is essential for that feature to work.

And which highlighting is it?

I got it! May be I’m wrong but I remember I commented strings without selection of highlighting.

Works fine here too. Did you try Kate as well? (does a much better job in highlighting various languages)

Yes, I did. I really don’t like this editor

???
Can you please elaborate?

KWrite and Kate should do exactly the same job in highlighting, as they both use exactly the same text editor component. (libktexteditor)
Only the GUI is different.

And the commenting doesn’t work in Kate here either without setting the highlighting.

Maybe it did work that way in some earlier version and got changed.
But it makes sense I think: how should Kate/KWrite know in which way it should comment out the text (’//’? ‘#’? Or something else?).
It has to know which language the file uses.

If you open an existing file, it should detect the correct highlighting automatically of course, you shouldn’t have to select it manually in this case.

Is it possible to change default highlightning?

I’m not sure.

You can configure which highlighting to use for certain mimetypes or filename patterns (“File extensions”) in Settings->Configure Editor…->Open/Save->Modes and Filetypes.
If you set the file extension to “*” for one particular highlighting, it will probably be used as default I’d guess.
But this would probably disable the automatic filetype recognition completely, or at least make it unreliable.

PS: You could try to set the file extension to an empty string for the wanted highlighting, and set it to something different like “xxxxx” for the default one.
This should make the other one the default without influencing the normal filetype recognition, I’d say.