After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625918 - Backspace should trigger a new completion
Backspace should trigger a new completion
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-03 09:14 UTC by Andrea Del Signore
Modified: 2013-06-17 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Doc: interactive completion and insertion/deletion in the buffer (1.82 KB, patch)
2013-06-13 15:14 UTC, Sébastien Wilmet
needs-work Details | Review
Doc: interactive completion and insertion/deletion in the buffer (1.81 KB, patch)
2013-06-17 14:37 UTC, Sébastien Wilmet
none Details | Review

Description Andrea Del Signore 2010-08-03 09:14:34 UTC
As told by jessevdk, in irc, this behavior was modified in commit f73ffecb
Comment 1 jessevdk@gmail.com 2010-08-03 09:25:11 UTC
Just to provide some more information, I don't think backspace should trigger a new interactive completion in all cases. Starting a completion each time you remove some text can be very annoying since what you are doing is not trying to insert new text, but to remove some text.

That said, something can be said for the case where you are in an interactive completion and type a wrong character (making it such that there are no matches in the provider) cancelling the interactive completion. In that case, starting again the interactive completion when removing the last character is desired. We need to think about if and how this can be implemented correctly.
Comment 2 Sébastien Wilmet 2012-04-22 20:41:44 UTC
It is possible to prevent the completion window to disappear when there is no proposals anymore, by adding a dummy proposal "No proposals" or something like that. With this method, when some characters are removed, new proposals can reappear.

Currently it must be explicitly handled by the provider, but we could think of a better way to do that with a new function in the API.
Comment 3 Sébastien Wilmet 2013-06-13 15:13:55 UTC
Instead of adding a new function in the API, I think we can simply document this. I'll attach a patch.
Comment 4 Sébastien Wilmet 2013-06-13 15:14:35 UTC
Created attachment 246733 [details] [review]
Doc: interactive completion and insertion/deletion in the buffer
Comment 5 Ignacio Casal Quinteiro (nacho) 2013-06-17 13:02:31 UTC
Review of attachment 246733 [details] [review]:

Some minor comments. Although maybe would be better to get a round from pbor too :)

::: gtksourceview/gtksourcecompletioncontext.c
@@ +46,3 @@
+ * only on insertion in the buffer, not on deletion. Once the completion window
+ * is visible, then on each insertion or deletion, there is a new population and
+ * the providers are asked to add proposals. If there is no more proposals, the

if there are no...

@@ +48,3 @@
+ * the providers are asked to add proposals. If there is no more proposals, the
+ * completion window disappears. So if you want to keep the completion window
+ * visible, but there is no proposals, you can insert a dummy proposal named for

there are

@@ +49,3 @@
+ * completion window disappears. So if you want to keep the completion window
+ * visible, but there is no proposals, you can insert a dummy proposal named for
+ * example "No proposals". For example, the user types progressively the name of

named "No proposals". (this way we do not put 2 times For example

@@ +51,3 @@
+ * example "No proposals". For example, the user types progressively the name of
+ * a function, and some proposals appear. The user types a bad character and
+ * there is no proposals anymore. What the user wants is to delete the last

there are
Comment 6 Sébastien Wilmet 2013-06-17 14:37:01 UTC
Created attachment 247038 [details] [review]
Doc: interactive completion and insertion/deletion in the buffer
Comment 7 Sébastien Wilmet 2013-06-17 19:10:11 UTC
Pushed to the master branch.