Open Bug 695654 Opened 14 years ago Updated 1 year ago

ctrl-u does not delete across lines (regression)

Categories

(Core :: DOM: Editor, defect)

x86_64
Linux
defect

Tracking

()

People

(Reporter: kdevel, Unassigned)

References

Details

Attachments

(2 files)

Attached file Testcase
User Agent: Steps to reproduce: 0. Enable Emacs keybindings*) 1. Open Testcase. **) 2. Move cursor behind the text (page down). ***) 3. Press ctrl-u five times. Actual results: 3. Text in third line is deleted, cursor at the beginning of third line. Expected results: 3. Textarea is empty (as in Fx 3.6).
OS: Other → Linux
Hardware: Other → x86_64
Attachment #568013 - Attachment mime type: text/plain → text/html
*) Put gtk-key-theme-name = "Emacs" into ~/.gtkrc-2.0 **) I get the Error Console message: Warning: Use of getAttributeNode() is deprecated. Use getAttribute() instead. Source File: https://bug695654.bugzilla.mozilla.org/attachment.cgi?id=568013 Line: 0 ***) In Fx 3.6 the focus() call places the cursor at the end of the text. Is this change intended? good 2010-08-31-03-mozilla-central 1b43ce0bda4f bad 2010-09-30-03-mozilla-central 5a2012482a63 maybe related to Bug 259810 "Ctrl+U works in textbox but not in textarea (when "emacs bindings" are enabled)".
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
> good 2010-08-31-03-mozilla-central 1b43ce0bda4f > bad 2010-09-30-03-mozilla-central 5a2012482a63 Can you possibly narrow down that range more? That's a _lot_ of changesets....
good 2010-09-13-03-mozilla-central 84ee6bc0484d bad 2010-09-14-03-mozilla-central 5588c9796f0b
Blocks: 240933
Status: UNCONFIRMED → NEW
Ever confirmed: true
The first bad revision is: changeset: 53732:75768c38273c user: Ehsan Akhgari <ehsan@mozilla.com> date: Mon Jul 19 16:19:27 2010 -0400 summary: Bug 240933 - Part 6: Put the selection on the moz BR element if the user presses Enter at the end of a textarea; r=roc a=dbaron http://hg.mozilla.org/mozilla-central/rev/75768c38273c
What is ctrl-u supposed to do? Can you please let me know how to reproduce the bug without emacs bindings?
(In reply to Ehsan Akhgari [:ehsan] from comment #6) > What is ctrl-u supposed to do? If the current cursor position is at the start of any but the first line remove the preceeding line break else If the current cursor position is at any but the first character of a line remove all characters from the first character of that line to the character preceeding the character of the current cursor position. > Can you please let me know how to reproduce > the bug without emacs bindings? Sorry, no I can't. This bug's issue is about FF having changed the emacs bindings' behavior in textareas, so in order to reproduce you need to enable it.
Ah, looking more closely, this is <http://mxr.mozilla.org/mozilla-central/source/content/xbl/builtin/emacs/platformHTMLBindings.xml#25>, which is cmd_deleteToBeginningOfLine, and now I can reproduce this.
Attached patch WIPSplinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Your patch now seems to implement this behavior: If there is only a single line delete it else If the current cursor position is in any but the first line set it to the first character in this line and delete the preceeding linebreak else Set the current cursor position to the first character of the next line and delete the preceeding linebreak.
Thanks for testing my patch, Stefan! Now, my question is: is this the behavior that you expect ctrl-u to have? I'm not an Emacs user myself, and I have no idea what the desired behavior is supposed to be. :-)
(In reply to Ehsan Akhgari [:ehsan] from comment #11) > Now, my question is: is this the behavior that you expect ctrl-u to have? Not yet. The behavior that I expect is described in Comment 7.
Sorry, I see that my description in Comment 7 is wrong in the sense that it does not match what FF 3.6 does. FF 3.6 in a first step deletes all the characters in the current line if there are any. If there are none and the cursor is not in the first line, it deleted the preceeding newline. If there are no characters in the current line and the cursor is in the first line, the trailing newline is deleted.
Sorry again. What FF 3.6 appears to do is this: If the current line is non-empty delete all characters in this line else { If there are lines after the current line delete the trailing line break (join current and next line) else If there are lines before the current line delete the preceeding line break (join previous with current line). }
(In reply to Stefan from comment #14) > Sorry again. What FF 3.6 appears to do is this: > > If the current line is non-empty delete all characters in this line > else { > If there are lines after the current line delete the trailing line > break (join current and next line) > else > If there are lines before the current line delete the preceeding line > break (join previous with current line). > } Hmm, for me, when I use 3.6 with the steps in comment 0, the last line gets deleted completely, and then further ctrl-u's do not seem to do anything...
What happens with the textcase if you put the cursor right at the start of the textarea and press ctrl-u five times?
In what version/what OS?
In that version/OS you used in Comment 15.
The first time, the first line gets deleted (excluding the trailing newline) and then nothing happens.
Assignee: ehsan → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: