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 309860 - select whitespace with double click
select whitespace with double click
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.6.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-07-09 00:25 UTC by Mike Miller
Modified: 2006-01-10 03:14 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
proposed patch (4.99 KB, patch)
2005-07-09 10:17 UTC, Paolo Borelli
none Details | Review

Description Mike Miller 2005-07-09 00:25:43 UTC
Every GUI based text editor I've ever used allows one to double click to select
the whitespace (spaces, tabs) indentation before and between words.

This is quite helpful when writing in a language that whitespace is important
such as python.  It is also helpful when trying to line up indentation in other
programming languages.

Nedit, on unix, or Textpad on Windows implement this behavior, for example.

Please consider this enhancement in a future version of gedit.  It is this one
small missing feature that keeps me from using the otherwise nice gedit more often.
Comment 1 Paolo Borelli 2005-07-09 10:11:26 UTC
Yep, good idea. I like this suggestion and I verified that emacs behaves in the
same way that you suggest.

However I think this should be implmented directly in GtkTextView so that all
the programs using it (gedit included) have this behavior. Reassigning to GTK+.
Comment 2 Paolo Borelli 2005-07-09 10:17:14 UTC
Created attachment 48856 [details] [review]
proposed patch

The patch implements the proposed behavior.

Since extend_selection cannot return FALSE anymore, I removed the return value
and modified the only caller (selection_motion_event_handler) which took the
return value into consideration.
Comment 3 Mike Miller 2005-07-09 20:10:31 UTC
OK, thanks for your time.
Comment 4 Matthias Clasen 2005-07-11 16:39:53 UTC
2005-07-11  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktextview.c (extend_selection): Make double-clicking
	between words select whitespace.  (#309860, Mike Miller, patch
	by Paolo Borelli)
Comment 5 Owen Taylor 2005-07-11 17:23:32 UTC
Shouldn't GtkTextView and GtkEntry behave consistently here?
Comment 6 Mike Miller 2005-07-12 01:10:54 UTC
Thanks again.  Which version of gtk? gnome?  can I expect this mini-feature to
come thru?  :)
Comment 7 Paolo Borelli 2005-07-12 07:06:51 UTC
gtk+-2.8 which will be used with gnome-2.12.

Since I'm already spamming here, I'll note that Matthias also fixed GtkEntry.
Comment 8 Mike Miller 2006-01-09 07:19:51 UTC
Sorry for the delay, but I've noticed two idiosyncracies with the implementation.  Should I report in another bug?

1)  If one double-clicks and selects the whitespace on a line that begins with a special character (like a double quote (python doc string), or less than bracket (html)) the selection includes that special character .... it shouldn't.

2)  After selection, hitting the tab key keeps the selection (doesn't lose it after the keypress) and additionally it moves only the text after the special characters!!!  (very, very strange)  ;)
Comment 9 Matthias Clasen 2006-01-10 03:14:12 UTC
Please file a new bug for these new issues