From patchwork Mon Apr 8 12:54:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ismael Luceno Cortes X-Patchwork-Id: 10889547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6CAF922 for ; Mon, 8 Apr 2019 13:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C019C286A7 for ; Mon, 8 Apr 2019 13:21:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE52D28741; Mon, 8 Apr 2019 13:21:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 556AF28786 for ; Mon, 8 Apr 2019 13:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfDHNVU convert rfc822-to-8bit (ORCPT ); Mon, 8 Apr 2019 09:21:20 -0400 Received: from mx1.silicon-gears.com ([81.47.169.96]:38384 "EHLO mx1.silicon-gears.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfDHNVT (ORCPT ); Mon, 8 Apr 2019 09:21:19 -0400 X-Greylist: delayed 1580 seconds by postgrey-1.27 at vger.kernel.org; Mon, 08 Apr 2019 09:21:19 EDT From: Ismael Luceno Cortes To: "git@vger.kernel.org" CC: Ismael Luceno Cortes , Junio C Hamano , "brian m. carlson" , "Pat Thoyts" Subject: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg Thread-Topic: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg Thread-Index: AQHU7gpDhunK4pRPI0qI99fjQdL07Q== Date: Mon, 8 Apr 2019 12:54:54 +0000 Message-ID: <20190408125406.16703-1-ismael.luceno@silicon-gears.com> Accept-Language: en-GB, es-ES, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-User-Approved-Sender: Yes;No X-TMASE-Result: 10--3.702900-10.000000 X-TMASE-MatchedRID: yHMs+sHflux0lqR8D0fH0d/wYmMFcJSIYYoLZVjtlFtSWdeg/8Oe81dm op201HzEG+Su3vFkPgokOZlozX424EYZ9RhNc4Kmz5r5y9mouSAk227IvqakhcAtnXPNjFICkb+ qhi+AKmf2vjmPQvPnDj7mUl9qbYX6b3gilrWi3GjDg+U1NSmcuSqQalMhs4UBXCmcAC8DBrMpY9 74Ts/ZMeLzNWBegCW2wguWqZ8eM0oLbigRnpKlKZx+7GyJjhAU5xJuB3oSRMsVscYZqITqEe9lO dRPxKWVUyvM97SZeVkMJnqMmx6lQ9AK73tscIFja1rCQb1ilOlveYZo3Zhiy+IhJf1KrZEyG/jZ 66588BoGV1/AyO9F1RcFbU5/D4/qqlHKWhDz7PzFhXMjdQIJpg== X-IMSS-DKIM-White-List: No;No X-TMASE-SNAP-Result: 1.821001.0001-0-1-12:0,22:0,33:0,34:0-0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Control+BackSpace: Delete word to the left of the cursor. - Control+Delete : Delete word to the right of the cursor. Originally introduced by BRIEF and Turbo Vision between 1985 and 1992, they were adopted by most CUA-Compliant UIs, including those of: OS/2, Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs. In both cases Tk already implements the functionality bound to other key combination, so we use that. Graphical examples: Deleting to the left: v------ pointer X_WORD____X ^-----^------ selection Deleting to the right: v--------- pointer X_WORD_X ^--^------ selection Signed-off-by: Ismael Luceno --- CC: Junio C Hamano CC: "brian m. carlson" CC: Pat Thoyts Notes: Changes since v2: - Reimplemented via existing events, which correctly delete spaces. - Further improved commit message. Changes since v1: - Improved commit message. git-gui/git-gui.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 6de74ce639..c4e0270626 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -3812,6 +3812,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break} bind $ui_comm <$M1B-Key-equal> {show_more_context;break} bind $ui_comm <$M1B-Key-plus> {show_more_context;break} bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break} +bind $ui_comm {event generate %W ;break} +bind $ui_comm {event generate %W ;break} bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break} bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}