Bug 434248 - keyboard shortcuts for comment/uncomment lines don't work in .conf files
Summary: keyboard shortcuts for comment/uncomment lines don't work in .conf files
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 20.12.2
Platform: Debian testing Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-03-10 18:21 UTC by Moltke
Modified: 2024-08-27 21:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moltke 2021-03-10 18:21:40 UTC
SUMMARY
I've noticed that keyboard shortcut for commenting lines in Kate(Ctrl + d) don't work in Debian Testing, they do in Stable though.

STEPS TO REPRODUCE
1. Launch Kate
2. Open a file in Kate 
3. Try to comment a line or group of lines with Ctrl + D

OBSERVED RESULT
Keyboard shortcut doesn't work as expected; lines don't get commented/uncommented. 



EXPECTED RESULT
Keyboard shortcut should work as expected; lines get commented/uncommented.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Debian Testing, Kernel: 5.10.0-4-amd64 x86_64 
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Moltke 2021-03-10 20:43:10 UTC
(In reply to Moltke from comment #0)
> SUMMARY
> I've noticed that keyboard shortcut for commenting lines in Kate(Ctrl + d)
> don't work in Debian Testing, they do in Stable though.
> 
> STEPS TO REPRODUCE
> 1. Launch Kate
> 2. Open a file in Kate 
> 3. Try to comment a line or group of lines with Ctrl + D
> 
> OBSERVED RESULT
> Keyboard shortcut doesn't work as expected; lines don't get
> commented/uncommented. 
> 
> 
> 
> EXPECTED RESULT
> Keyboard shortcut should work as expected; lines get commented/uncommented.
> 
> SOFTWARE/OS VERSIONS
> Windows: 
> macOS: 
> Linux/KDE Plasma: Debian Testing, Kernel: 5.10.0-4-amd64 x86_64 
> (available in About System)
> KDE Plasma Version: 5.20.5
> KDE Frameworks Version: 5.78.0
> Qt Version: 5.15.2
> 
> ADDITIONAL INFORMATION

All is good. Turns out the shortcut only works with files ending in .sh, .py and probably other script extensions but not in some txt.conf file, like conky.conf, and I didn't know that, untill now. :) Sorry for the trouble.
Comment 2 Nate Graham 2021-03-11 21:03:06 UTC
Yup, kate has to detect the file as a code file, since comments only exist in the context of code.

However Configuration files also often have comments, so perhaps we should support those too.
Comment 3 Moltke 2021-03-12 00:37:21 UTC
(In reply to Nate Graham from comment #2)
> Yup, kate has to detect the file as a code file, since comments only exist
> in the context of code.
> 
> However Configuration files also often have comments, so perhaps we should
> support those too.

That'd be nice. :-) I was editing my conky.conf file when noticed it didn't work, and realized what you mentioned when editing some script. Thanks for the reply.
Comment 4 Christoph Cullmann 2024-08-27 19:21:08 UTC
If we detect that it is an ini file, we allow that. .conf is used for a different file format, you can configure that in the settings. (settings -> open/save -> mode/filetypes)
Comment 5 Moltke 2024-08-27 21:27:23 UTC
(In reply to Christoph Cullmann from comment #4)
> If we detect that it is an ini file, we allow that. .conf is used for a
> different file format, you can configure that in the settings. (settings ->
> open/save -> mode/filetypes)

Yes, but there are many options there, for example, which one would be for like conky.conf file? Or any other "app.conf" file for that matter?