Opened 14 years ago

Closed 5 years ago

Last modified 5 years ago

#7674 closed enhancement (fixed)

Add backward-kill-word to BTextView

Reported by: GeneralMaximus Owned by: nobody
Priority: normal Milestone: R1/beta2
Component: Kits/Interface Kit Version:
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

A backward-kill-word shortcut in BTextView would be a welcome addition. The current method of killing the previous word by holding Shift, then pressing Ctrl+Left to select the word, and finally pressing Backspace is cumbersome.

Since Ctrl+Backspace is already mapped to Delete, the attached patch makes Option+Backspace kill the previous word. But there's a consistency issue here: moving between words is done using Ctrl+Left and Ctrl+Right so, logically, Ctrl+Backspace should kill the previous word. Instead, I've attached an additional patch that changes Ctrl+Left and Ctrl+Right to Option+Left and Option+Right. Now all text movement shortcuts are accessed through the Option key. I was not sure if this was a good idea, so I made a separate patch.

Description of patches:

  1. backward-kill-word.diff: makes Option+Backspace kill the previous word.
  2. backward-kill-word-and-backward-word.diff: makes Option+Backspace kill the previous word. Additionally, Option+Left Arrow and Option+Right Arrow are used to move back or forward by words. This is a change from the previous way of moving between words, which was Ctrl+Left Arrow and Ctrl+Right Arrow.

Attachments (2)

backward-kill-word.diff (783 bytes ) - added by GeneralMaximus 14 years ago.
backward-kill-word-and-backward-word.diff (1.5 KB ) - added by GeneralMaximus 14 years ago.

Download all attachments as: .zip

Change History (13)

by GeneralMaximus, 14 years ago

Attachment: backward-kill-word.diff added

comment:1 by GeneralMaximus, 14 years ago

patch: 01

by GeneralMaximus, 14 years ago

comment:2 by humdinger, 14 years ago

Is there a reason to have CTRL+BACKSPACE simulating DELETE? I mean, there's a whole separate key dedicated to this action... I'd much rather have CTRL+BACKSPACE do the killing (+ CTRL+DELETE doing the forward kill).

The German keymap doesn't have the CTRL+BACKSPACE == DELETE by the way.

comment:3 by axeld, 14 years ago

The poor Apple users don't have a delete key, so I guess the shortcut is for them. But I would agree that this should be changed - on a Mac, it's even "Fn-Backspace", and that might even work on Haiku as well (haven't checked, though).

comment:4 by GeneralMaximus, 14 years ago

I'd rather have Option+Backspace instead of Ctrl+Backspace. Here's why: AFAIK, currently you can't send Meta to the Haiku terminal. If we set Option as the Meta key in Terminal, we can use all the awesome readline shortcuts mapped to Meta (see: http://www.bigsmoke.us/readline/shortcuts). We can then add some of the same readline shortcuts to BTextView and get limited readline-style editing in all GUI apps. If you spend a lot of time in readline-powered tools, this saves you a context switch when you Ctrl+Tab to Vision or WebPositive. Mac OS X already does this with all Cocoa text controls.

Since this is something I'd really like to see, I'm willing to send in more patches. Only if this is desirable, of course.

That said, the Ctrl+Bkspc => Del mapping in the US keymap is not very useful. Most US keyboards have the Del key either physically, or at least through the Fn key.

comment:5 by axeld, 14 years ago

The option key is actually not available on all keyboards, and for being consistent, the control-delete/backspace mapping makes the most sense to me.

I see no meta in the shortcuts you linked to, and at least the control ones already work fine. IIRC some of them will also work in BTextView.

comment:6 by GeneralMaximus, 14 years ago

I see no meta in the shortcuts you linked to, and at least the control ones already work fine. IIRC some of them will also work in BTextView.

Call me a pedant, but all occurences of "Alt" in that list should be changed to "Meta". Since we're using Alt as Command in the default layout, Option is the next best choice.

comment:7 by tqh, 13 years ago

Reading comment:3 and comment:5 it seems the patches in their current form are not ok. Making the patches obsolete so that they don't need to be reviewed any more times in their current form.

comment:8 by tqh, 13 years ago

patch: 10

comment:9 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:10 by humdinger, 5 years ago

Resolution: fixed
Status: assignedclosed

This was implemented with hrev53255.

comment:11 by nielx, 5 years ago

Milestone: R1R1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.