Open
Bug 695654
Opened 14 years ago
Updated 1 year ago
ctrl-u does not delete across lines (regression)
Categories
(Core :: DOM: Editor, defect)
Tracking
()
NEW
People
(Reporter: kdevel, Unassigned)
References
Details
Attachments
(2 files)
|
197 bytes,
text/html
|
Details | |
|
2.81 KB,
patch
|
Details | Diff | Splinter Review |
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).
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)".
Updated•14 years ago
|
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
Comment 2•14 years ago
|
||
> 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
Comment 4•14 years ago
|
||
That corresponds to http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=84ee6bc0484d&tochange=5588c9796f0b
Possibly a regression from bug 240933?
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
Comment 6•13 years ago
|
||
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.
Comment 8•13 years ago
|
||
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.
Comment 9•13 years ago
|
||
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
| Reporter | ||
Comment 10•13 years ago
|
||
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.
Comment 11•13 years ago
|
||
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. :-)
| Reporter | ||
Comment 12•13 years ago
|
||
(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.
| Reporter | ||
Comment 13•13 years ago
|
||
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.
| Reporter | ||
Comment 14•13 years ago
|
||
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).
}
Comment 15•13 years ago
|
||
(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...
| Reporter | ||
Comment 16•13 years ago
|
||
What happens with the textcase if you put the cursor right at the start of the textarea and press ctrl-u five times?
Comment 17•13 years ago
|
||
In what version/what OS?
| Reporter | ||
Comment 18•13 years ago
|
||
In that version/OS you used in Comment 15.
Comment 19•13 years ago
|
||
The first time, the first line gets deleted (excluding the trailing newline) and then nothing happens.
Updated•6 years ago
|
Assignee: ehsan → nobody
Status: ASSIGNED → NEW
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•