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 627766 - Default behavior of alt/option key not working
Default behavior of alt/option key not working
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.30.x
Other Mac OS
: Normal major
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-23 20:34 UTC by Pedro Estarque
Modified: 2012-01-08 18:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pedro Estarque 2010-08-23 20:34:30 UTC
The alt/option key is used in standard Cocoa/Carbon text fields to skip entire words when used with the arrow keys or delete entire words with the delete key. 
Neither behavior works in gEdit by default (it does with the control key, but that's not the default behavior in MacOS and old habits die hard)

Adding this lines to gedit.app/Contents/Resources/etc/gtk-2.0/gtkrc fixes it:

binding "gtk-mac-alt-arrows"
{
  bind "<alt>Right"           { "move-cursor" (words, 1, 0) }
  bind "<alt>KP_Right"        { "move-cursor" (words, 1, 0) }
  bind "<alt>Left"            { "move-cursor" (words, -1, 0) }
  bind "<alt>KP_Left"         { "move-cursor" (words, -1, 0) }
  bind "<shift><alt>Right"    { "move-cursor" (words, 1, 1) }
  bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) }
  bind "<shift><alt>Left"     { "move-cursor" (words, -1, 1) }
  bind "<shift><alt>KP_Left"  { "move-cursor" (words, -1, 1) }
}

class "GtkTextView" binding "gtk-mac-alt-arrows"
class "GtkLabel" binding "gtk-mac-alt-arrows"
class "GtkEntry" binding "gtk-mac-alt-arrows"


binding "gtk-mac-alt-delete"
{
  bind "<alt>Delete" { "delete-from-cursor" (word-ends, 1) }
  bind "<alt>KP_Delete" { "delete-from-cursor" (word-ends, 1) }
  bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) }
}

class "GtkTextView" binding "gtk-mac-alt-delete"
class "GtkEntry" binding "gtk-mac-alt-delete"
Comment 1 Bengt Olsson 2011-03-13 09:52:49 UTC
Could a similar work-around temporarily resolve bug 609019 also? Bug 609019 effectively prohibits use of gedit on mac and should have higher prio IMHO.
Comment 2 damonkashu 2011-04-01 17:50:46 UTC
This was reported back in mid 2010 and I'm surprised it hasn't been fixed in the mac binary, would it be difficult to change?
Comment 3 Ignacio Casal Quinteiro (nacho) 2011-04-01 18:20:59 UTC
that's because we didn't make a major release since then, the next one will be in 3 days, so probably this kind of things will be fixed soon.
Comment 4 Pedro Estarque 2011-04-03 01:44:00 UTC
While you are at it, cmd-up/down also won't  go to the top/bottom of the document
Comment 5 jessevdk@gmail.com 2012-01-08 18:59:56 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.