Code

git-gui: fix deleting from the context menu with empty selection
authorMarkus Heidelberg <markus.heidelberg@web.de>
Sun, 29 Mar 2009 14:29:23 +0000 (15:29 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 30 Mar 2009 14:06:37 +0000 (07:06 -0700)
An "Application Error" was raised when trying to delete text from the
commit message field when no text was selected.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh

index 2f1f305019a1af1aec5f9885468188c9daa7a8ef..b3aa7325f037b8a4c918859f639e7aa210a1f107 100755 (executable)
@@ -2944,7 +2944,7 @@ $ctxm add command \
        -command {tk_textPaste $ui_comm}
 $ctxm add command \
        -label [mc Delete] \
-       -command {$ui_comm delete sel.first sel.last}
+       -command {catch {$ui_comm delete sel.first sel.last}}
 $ctxm add separator
 $ctxm add command \
        -label [mc "Select All"] \