RESOLVED FIXED 4062
Word completion doesn't work at end of word (unless last word)
https://bugs.webkit.org/show_bug.cgi?id=4062
Summary Word completion doesn't work at end of word (unless last word)
Duncan Wilcox
Reported 2005-07-18 15:01:35 PDT
Pressing cmd+esc will invoke the webview complete: method, that will popup a list of words that complete the text typed so far. This functionality only works if you hit cmd-esc after the last word on the page, or if you type cmd-esc while within a word. It doesn't work if you hit cmd-esc at the end of a word that is not the last one. In the attached sample hit cmd-esc when the cursor is just after "one", you will get a NSBeep(). If you hit cmd-esc with the cursor after "three" it will work. A rough guess is that this happens because -[WebTextCompleteController doCompletion] is calling [bridge rangeByExpandingSelectionWithGranularity:WebSelectByWord] that doesn't work when a space follows the cursor. The spelling suggestion functionality appears to be filtered away by safari, so it's not testable with a plain web page.
Attachments
test case (1.43 KB, text/plain)
2005-07-18 15:07 PDT, Duncan Wilcox
no flags
proposed patch (use rangeByAlteringCurrentSelection) (3.48 KB, patch)
2005-10-27 12:12 PDT, Alexey Proskuryakov
no flags
proposed patch (use rangeByAlteringCurrentSelection) (967 bytes, patch)
2005-10-27 12:14 PDT, Alexey Proskuryakov
darin: review+
Duncan Wilcox
Comment 1 2005-07-18 15:07:32 PDT
Created attachment 3007 [details] test case Create a cocoa app in xcode, replace main.m with the attachment and add the WebKit.framework to the project.
Alexey Proskuryakov
Comment 2 2005-10-26 12:49:49 PDT
Confirmed with ToT (running Blot)
Alexey Proskuryakov
Comment 3 2005-10-27 12:12:48 PDT
Created attachment 4490 [details] proposed patch (use rangeByAlteringCurrentSelection) I have also thought about changing rangeByExpandingSelectionWithGranularity: to work in this case, but this seems to require quite a number of changes to how a selection's affinity is set in various places, which may or may not be desirable...
Alexey Proskuryakov
Comment 4 2005-10-27 12:14:11 PDT
Created attachment 4491 [details] proposed patch (use rangeByAlteringCurrentSelection) An unrelated change sneaked into the patch...
Darin Adler
Comment 5 2005-10-27 21:47:12 PDT
Comment on attachment 4491 [details] proposed patch (use rangeByAlteringCurrentSelection) Looks fine. r=me
Note You need to log in before you can comment on or make changes to this bug.