funnel icon indicating copy to clipboard operation
funnel copied to clipboard

Control-W ("backward-delete-word") in text fields breaks sporadically

Open ppaeps opened this issue 10 years ago • 5 comments

Test environment

Safari version 9.0.1 (11601.2.7.2) on Mac OS X version. 10.11.1 (15B42). Note that the default keybindings on MacOS X are buggy. You need to have the following in your ~/Library/KeyBindings/DefaultKeyBinding.dict file:

 {
    "^w" = "deleteWordBackward:";
}

Test case

Start typing a comment on e.g. https://rootconf.talkfunnel.com/2016/2-dnssec-workshop Type the words: "This is a test comment. I wonder if I can delete all the words." Now type control-W control-W control-W

Expected behaviour

Only "This is a test comment. I wonder if I can delete all" should remain in the text field.

Actual behaviour

The string "This is a test comment. I wonder if I can delete all the wo" remains in the text field. Switching back and forth between browser tabs breaks control-W altogether. Other keyboard shortcuts (control-A, control-E, control-U and control-K) seem unaffected. Only control-W is broken.

I have not tested this on other platforms. But deleting words backwards with control-W works in every other text box I have encountered. Including the one in which I'm typing this very bug report! :)

ppaeps avatar Dec 21 '15 14:12 ppaeps

The text widget is CodeMirror, which simulates a textarea field. It has its own key bindings. We should add ^W and other common Emacs keybindings there as many people will expect them to just work.

Unfortunately there is no way (that I know of) to access Cocoa bindings from the browser environment for cases where the user has custom settings.

jace avatar Dec 22 '15 06:12 jace

Hah. Thank you!

ppaeps avatar Apr 07 '20 02:04 ppaeps

Alas, not fixed. That commit referred to hasgeek/lastuser#158 (we merged repositories).

jace avatar May 02 '20 08:05 jace

This issue is likely to remain unresolved until CodeMirror 6 becomes available, or we switch to ProseMirror.

jace avatar May 02 '20 08:05 jace

CodeMirror 6 is now stable for use, and we'll switch whenever we can catch our breath from pressing issues.

jace avatar Apr 27 '21 21:04 jace