{"thread":{"id":"50522","subject":"[PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","startedAt":"2019-02-16T03:11:31Z","lastAt":"2019-03-04T14:09:55Z","messageCount":5,"participants":["Ismael Luceno","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"369427","messageId":"20190216031051.8859-1-ismael@iodev.co.uk","threadId":"50522","inReplyTo":null,"subject":"[PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","fromName":"Ismael Luceno","fromEmail":"ismael@iodev.co.uk","sentAt":"2019-02-16T03:10:52Z","receivedAt":"2019-02-16T03:11:31Z","isPatch":true,"sender":{"key":"ismael@iodev.co.uk","avatar":"https://avatars.githubusercontent.com/u/426980?v=4"},"body":"- Control+BackSpace: Delete word to the left of the cursor.\n- Control+Delete   : Delete word to the right of the cursor.\n\nOriginally introduced by BRIEF and Turbo Vision between 1985 and 1992,\nthey were adopted by most CUA-Compliant UIs, including those of: OS/2,\nWindows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.\n\nSigned-off-by: Ismael Luceno <ismael@iodev.co.uk>\n---\n\nNotes:\n    Changes since v1:\n    - Improved commit message.\n\n git-gui.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 5bc21b878d41..e00d9a345294 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -3788,6 +3788,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}\n bind $ui_comm <$M1B-Key-equal> {show_more_context;break}\n bind $ui_comm <$M1B-Key-plus> {show_more_context;break}\n bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}\n+bind $ui_comm <Control-Key-BackSpace> {%W delete {insert -1 chars wordstart} insert;break}\n+bind $ui_comm <Control-Key-Delete> {%W delete insert {insert wordend};break}\n \n bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}\n bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}\n-- \n2.20.1\n\n"},{"id":"369734","messageId":"xmqqbm36w7hl.fsf@gitster-ct.c.googlers.com","threadId":"50522","inReplyTo":"20190216031051.8859-1-ismael@iodev.co.uk","subject":"Re: [PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-20T20:05:42Z","receivedAt":"2019-02-20T20:05:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ismael Luceno <ismael@iodev.co.uk> writes:\n\n> - Control+BackSpace: Delete word to the left of the cursor.\n> - Control+Delete   : Delete word to the right of the cursor.\n>\n> Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,\n> they were adopted by most CUA-Compliant UIs, including those of: OS/2,\n> Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.\n>\n> Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>\n> ---\n>\n> Notes:\n>     Changes since v1:\n>     - Improved commit message.\n\nI do not use git-gui, but as a bystander, the intent of the change\nsounds sane.  deleting from the insertion cursor to the end of the\nword where the insertion cursor is looks like the right way to\ndelete the word to the right of the cursor.  I am not sure if going\nback by one character from where the current insertion cursor is and\nfurther go back to the wordstart would give the beginning of the\nword to the left of the cursor, though.\n\nA larger issue is that we haven't heard from Pat, who has been\nhelping git-gui.sh maintenance, for quite a while, so we'd need to\nfind a volunteer to act as a replacement maintainer.  If you are\nwilling to, that would be great ;-)\n\nThanks.\n\n\n>  git-gui.sh | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/git-gui.sh b/git-gui.sh\n> index 5bc21b878d41..e00d9a345294 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -3788,6 +3788,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}\n>  bind $ui_comm <$M1B-Key-equal> {show_more_context;break}\n>  bind $ui_comm <$M1B-Key-plus> {show_more_context;break}\n>  bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}\n> +bind $ui_comm <Control-Key-BackSpace> {%W delete {insert -1 chars wordstart} insert;break}\n> +bind $ui_comm <Control-Key-Delete> {%W delete insert {insert wordend};break}\n>  \n>  bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}\n>  bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}\n"},{"id":"369762","messageId":"20190221093059.GA6594@kiki","threadId":"50522","inReplyTo":"xmqqbm36w7hl.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","fromName":"Ismael Luceno","fromEmail":"ismael@iodev.co.uk","sentAt":"2019-02-21T09:31:00Z","receivedAt":"2019-02-21T09:31:08Z","isPatch":true,"sender":{"key":"ismael@iodev.co.uk","avatar":"https://avatars.githubusercontent.com/u/426980?v=4"},"body":"On 20/Feb/2019 12:05, Junio C Hamano wrote:\n> Ismael Luceno <ismael@iodev.co.uk> writes:\n> \n> > - Control+BackSpace: Delete word to the left of the cursor.\n> > - Control+Delete   : Delete word to the right of the cursor.\n> >\n> > Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,\n> > they were adopted by most CUA-Compliant UIs, including those of: OS/2,\n> > Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.\n> >\n> > Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>\n> > ---\n> >\n> > Notes:\n> >     Changes since v1:\n> >     - Improved commit message.\n> \n> I do not use git-gui, but as a bystander, the intent of the change\n> sounds sane.  deleting from the insertion cursor to the end of the\n> word where the insertion cursor is looks like the right way to\n> delete the word to the right of the cursor.  I am not sure if going\n> back by one character from where the current insertion cursor is and\n> further go back to the wordstart would give the beginning of the\n> word to the left of the cursor, though.\n\nGraphical explanation:\n\nDeleting to the left:\n      v----- pointer\nX_WORD_X\n  ^--^------ selection\n\nDeleting to the right:\n  v--------- pointer\nX_WORD_X\n  ^--^------ selection\n\n\nCurrent implementation doesn't behave correctly when there's multiple\nspaces:\n\nDeleting to the left:\n        v--- pointer\nX_WORD____X\n       ^---- selection\n\nDeleting to the right:\n  v--------- pointer\nX____WORD_X\n  ^--------- selection\n\n\n> A larger issue is that we haven't heard from Pat, who has been\n> helping git-gui.sh maintenance, for quite a while, so we'd need to\n> find a volunteer to act as a replacement maintainer.  If you are\n> willing to, that would be great ;-)\n\nSure.\n"},{"id":"369850","messageId":"xmqqa7iouavw.fsf@gitster-ct.c.googlers.com","threadId":"50522","inReplyTo":"20190221093059.GA6594@kiki","subject":"Re: [PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-21T20:47:31Z","receivedAt":"2019-02-21T20:47:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ismael Luceno <ismael@iodev.co.uk> writes:\n\n>> ....  I am not sure if going\n>> back by one character from where the current insertion cursor is and\n>> further go back to the wordstart would give the beginning of the\n>> word to the left of the cursor, though.\n>\n> ...\n> Current implementation doesn't behave correctly when there's multiple\n> spaces:\n\nIn short, I wondered if it is correct, and you say it is not correct.\n\nI would be surprised if git-gui were the only program that\nimplemented an editor-like feature using tcl/tk, and none of the\nother editor implementations using tcl/tk had such an industry\nstandard \"delete previous word\".  Perhaps you can see if there\nis already a correct implementation of the feature this patch can\nborrow from?\n\n>> A larger issue is that we haven't heard from Pat, who has been\n>> helping git-gui.sh maintenance, for quite a while, so we'd need to\n>> find a volunteer to act as a replacement maintainer.  If you are\n>> willing to, that would be great ;-)\n>\n> Sure.\n"},{"id":"370603","messageId":"20190304140947.GA2449@kiki","threadId":"50522","inReplyTo":"xmqqa7iouavw.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2] git-gui: Handle Ctrl + BS/Del in the commit msg","fromName":"Ismael Luceno","fromEmail":"ismael@iodev.co.uk","sentAt":"2019-03-04T14:09:47Z","receivedAt":"2019-03-04T14:09:55Z","isPatch":true,"sender":{"key":"ismael@iodev.co.uk","avatar":"https://avatars.githubusercontent.com/u/426980?v=4"},"body":"On 21/Feb/2019 12:47, Junio C Hamano wrote:\n> Ismael Luceno <ismael@iodev.co.uk> writes:\n> \n> >> ....  I am not sure if going\n> >> back by one character from where the current insertion cursor is and\n> >> further go back to the wordstart would give the beginning of the\n> >> word to the left of the cursor, though.\n> >\n> > ...\n> > Current implementation doesn't behave correctly when there's multiple\n> > spaces:\n> \n> In short, I wondered if it is correct, and you say it is not correct.\n\nIt's better than nothing, and the behavior isn't harmful.\n\n> I would be surprised if git-gui were the only program that\n> implemented an editor-like feature using tcl/tk, and none of the\n> other editor implementations using tcl/tk had such an industry\n> standard \"delete previous word\".  Perhaps you can see if there\n> is already a correct implementation of the feature this patch can\n> borrow from?\n\nI couldn't find such implementation yet. I'll come up with an improved\nversion if there's nothing else, but in the meanwhile it's worth to have\nthis one merged.\n"}]}