Bug 300453

Summary: word completion inside word should delete any part of word after cursor
Product: [Applications] kate Reporter: Andreas Nordal <andreas_nordal_4>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: christoph, i.zaufi, scarpino
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 89576    

Description Andreas Nordal 2012-05-22 14:05:30 UTC
This is a wish for a different solution to the problem described in bug 89576 aka
«word completion doesn't use latter part of word to suggest better hint»:

In Kate and Kwrite, when placing the cursor inside a word, word completion only considers the first part of the word (as delimited by the cursor) to suggest completions. I think this is totally fine.
    However, after choosing a completion, the second half is still there, as a suffix to the word I just chose to complete. I find myself always deleting that leftover suffix. I want it to be deleted automatically.

Reproducible: Always

Steps to Reproduce:
1. in Kate, write (without quotes) the names "Jensen" and "Hansen" on separate lines
2. mark "Han" and overwrite it with "Jen"
3. if you have word completion enabled after 3 characters, Kate will now suggest that you mean "Jensen". Let it complete that for you.

Actual Results:  
Kate has now invented the name "Jensensen" for you.

Expected Results:  
Just "Jensen" would be fine.

By not deleting the leftover suffix, Kate is taking word completion to a whole new level by inventing new words. This is NOT behavior you need or expect from a «word completion» feature.

How this wish is a prerequisite to wish 89576:
The leftover suffix has to be deleted anyway. Taking the second part of the word into account «to suggest better hint» can be implemented later.

How I don't like wish 89576:
I'm not sure I even want a «better hint», if that means narrowing the search. Shouldn't "Jenny" be considered for completion of "Jen" regardless of "sen" being after the cursor? I don't know. One can always narrow the search further (exclude Jenny) by typing more characters.
Comment 1 Alex Turbov 2013-08-19 19:34:35 UTC
> However, after choosing a completion, the second half is still there, as a suffix to the word I just chose to complete. I find myself always deleting that leftover suffix. I want it to be deleted automatically.

This feature has been implemented in 4.11 release (as default behaviour, w/ configurable option for an old style)
Comment 2 Christoph Cullmann 2015-08-01 21:08:33 UTC
I think it is ok that way, without config option.