Bug 468705

Summary: Autocomplete should prefer current input when this is a match
Product: [Applications] kate Reporter: Diggory Hardy <kde2>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: christoph
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Diggory Hardy 2023-04-20 08:33:25 UTC
SUMMARY
When generating autocomplete suggestions, consider words of min-autocomplete-length (default 3 chars) as valid candidates and make the preferred candidate.

Currently autocompletion is frustrating enough when typing text with explicit line breaks that I *almost* want to turn it off.

STEPS TO REPRODUCE
1. Start a new document and type in a few words including 'the' and these'
2. Write 'the'
3. Press <Enter> to insert an explicit line-break

OBSERVED RESULT
'the' is "completed" to 'these'

EXPECTED RESULT
Line break, or failing that autocomplete to 'the' (no effect except to close autocompletion)

Exact behaviour here is debatable, but personally I find "completion" of a valid word when I just wanted to insert a line-break to be annoying!
Comment 1 Christoph Cullmann 2023-04-22 17:53:37 UTC
Perhaps it would make sense to have some completion support using the current spell checker. One can the insert a word itself if it is ok or all known suggestions.

e.g. like the KateKeywordCompletionModel does atm for keywords from the hl files.
Comment 2 Christoph Cullmann 2023-04-23 14:17:33 UTC
Will take care of this, seems like a nifty little feature.
Comment 3 Bug Janitor Service 2023-04-23 15:05:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/544
Comment 4 Christoph Cullmann 2023-04-29 16:41:54 UTC
Could you try my merge request?
Comment 5 Christoph Cullmann 2023-05-01 14:33:14 UTC
Git commit 6bc40ca3629da7879d4d8e5643e1a0df02a1f980 by Christoph Cullmann.
Committed on 01/05/2023 at 14:15.
Pushed by cullmann into branch 'word/spelling'.

ensure words that are ok spell check wise always end up in the completion

M  +16   -0    src/completion/katewordcompletion.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/6bc40ca3629da7879d4d8e5643e1a0df02a1f980