Bug 475466

Summary: Key to confirm suggestion
Product: [Applications] kate Reporter: Matthias <shalokshalom>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: christoph, waqar.17a
Priority: NOR    
Version First Reported In: 23.08.1   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Idea for the implementation
Conflict with this setting

Description Matthias 2023-10-11 13:46:05 UTC
Created attachment 162220 [details]
Idea for the implementation

SUMMARY

I like to insert the suggested value of auto-completion with tab, and not with Enter. 
Please see the attached screenshot, to see how this could look like.  

The current approach allows only to disable autocompletion at all or to disable the preselection of the first suggestion. 
Other than that, is there no way, to not have the enter key insert suggestions, when I actually just want to insert a newline. 

Other editors, like VSCode, already support this.
Comment 1 Matthias 2023-10-11 13:50:44 UTC
In case we implement that, be aware that it conflicts with the setting "Cycle through the results with tab/shift+tab"

Two possible ways to solve that could be:

a) Make the key(s) to cycle through the results customizable as well
b) Disable this setting, if the other setting is enabled and vice versa
Comment 2 Matthias 2023-10-11 13:51:17 UTC
Created attachment 162221 [details]
Conflict with this setting
Comment 3 Waqar Ahmed 2023-10-11 14:22:24 UTC
You can press Ctrl+Enter to insert a newline
Comment 4 Matthias 2023-10-11 14:53:12 UTC
Yeah, I would rather use Ctrl+Enter to accept the suggestion. 
Ctrl+Enter is very unnatural to me for entering a newline, since Kate would be the only program that does so. 
All other programs that let my edit text, enter a newline. 
As this field in bugzilla :D
Comment 5 Waqar Ahmed 2023-10-11 15:12:34 UTC
Its not unnatural for an advanced text editor made for programming when in the context of autocompletion. We also have ctrl+shift+enter/ctrl+alt+enter. Perhaps you should use kwrite, it might not have this issue.

In any case, it's simple to implement such a setting so can be a good first task.
Comment 6 Matthias 2023-10-11 19:52:35 UTC
Thanks a lot. 

I very much use Kate as an IDE.
Comment 7 Christoph Cullmann 2023-12-18 19:16:22 UTC
Is an valid wish, if somebody has time, please provide some merge request: https://kate-editor.org/join-us/
Comment 8 Waqar Ahmed 2024-09-30 15:54:28 UTC
This was fixed earlier this year.  There is a new option: "Use Enter key to insert selected completion", if you uncheck it Enter will just add a \n