# Re: [PATCH] git-gui: fix deleting from the context menu with empty selection

1 messages from 2009-03-30 to 2009-03-30. Participants: Shawn O. Pearce.
Thread: https://gitlist.dev/t/18642

## Shawn O. Pearce, 2009-03-30 14:07

Subject: Re: [PATCH] git-gui: fix deleting from the context menu with empty selection
Message-ID: <20090330140750.GU23521@spearce.org>
URL: https://gitlist.dev/e/20090330140750.GU23521%40spearce.org
In-Reply-To: <200903291629.23736.markus.heidelberg@web.de>

```
Markus Heidelberg <markus.heidelberg@web.de> wrote:
> An "Application Error" was raised when trying to delete text from the
> commit message field when no text was selected.

Thanks.

> diff --git a/git-gui.sh b/git-gui.sh
> index 2f1f305..b3aa732 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -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"] \

-- 
Shawn.

```
