| Summary: | Return key to accept auto complete breaks text input for some languages | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Ellie <el> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph, waqar.17a |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.4 | ||
| Target Milestone: | --- | ||
| Platform: | Flatpak | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/frameworks/ktexteditor/-/commit/6a87ba2a39fcf5d33242468d71178b79bef9188f | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Ellie
2024-01-22 16:16:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/660 Ooh that's so great that someone is looking at it! Maybe this is helpful: I've been thinking some more, maybe the least controversial setting would have the options for accepting auto-complete with enter of "Always On", "Language-Dependent", "Always Off"? With "Language-Dependent" depending on some syntax-highlighting.xml attribute for the "language" tag similar to the "indenter" one, it could maybe be named "autocomplete_enter_by_default" and have a value of "true"/"false"? If it's "false" then the "Language-Dependent" setting would turn it off too. Maybe it's just me but I think for Lua and Python and Go for example it would be better to default this to "off" for people who want a smart language dependent behavior, while of course for C/C++/Rust it wouldn't be an issue. I hope this is somehow helping. We have other ways to pre configure stuff for certain languages without involving syntax highlighting, but we only do that if we are 100% sure that this is the right thing to do i.e.,no opinions there. For e.g., using tabs for Go language. You can still configure this per language/file-type though, but its something the user will have to decide for themselves. Hm, but why wouldn't you want to have the hopefully most sane default based on file type out of the box? I guess if the XML isn't the right place for it, it could be kept in some other place. If you really wanted a unified default no matter what, then maybe the less destructive disabling of enter to pick an auto complete item might be the better choice. Especially if the popup has a short help text instructing to use tab, this doesn't seem likely to confuse anyone and won't occasionally somewhat literally break any typed code. Git commit 93e0d56d0e13fca4e33a3dd6e460d9a1986c82a8 by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 24/01/2024 at 09:37. Pushed by cullmann into branch 'master'. Allow to configure 'enter-to-insert-completion' per file type M +1 -1 src/dialogs/completionconfigtab.ui M +24 -21 src/document/katedocument.cpp M +1 -0 src/include/ktexteditor/view.h M +1 -1 src/inputmode/katenormalinputmode.cpp M +1 -1 src/utils/kateconfig.cpp M +5 -0 src/variableeditor/variablelineedit.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/93e0d56d0e13fca4e33a3dd6e460d9a1986c82a8 Git commit 6a87ba2a39fcf5d33242468d71178b79bef9188f by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 24/01/2024 at 09:37. Pushed by cullmann into branch 'master'. Allow disabling 'enter to insert completion' By default it is enabled M +12 -2 src/dialogs/completionconfigtab.ui M +3 -0 src/dialogs/katedialogs.cpp M +7 -1 src/inputmode/katenormalinputmode.cpp M +1 -0 src/utils/kateconfig.cpp M +1 -0 src/utils/kateconfig.h https://invent.kde.org/frameworks/ktexteditor/-/commit/6a87ba2a39fcf5d33242468d71178b79bef9188f Thanks so much for fixing it! I still would hope for a better default but I'm guessing the close means it was fully decided against now Changing this default means breaking other people's workflow (established since 20 years). I am usually against this unless there is a good reason to break a workflow. Wouldn't it be possible to only change the default for new installs? And only for the languages where it makes sense, that's part of why I suggested a language-dependent default. I assume most C/C++ coders for example would expect return key for auto-complete. However, for Lua for example this is an entirely different matter. I think the default shall stay at is, we got close to zero complaints about that for over a decade, that means it can't be that bad. That seems like a logical fallacy, but I guess I can't change your mind. My assumption would be most users who ran into this either begrudgingly put up with it, or just moved on to other editors. |