This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 51813 - remove-word sometimes deletes *following* word
Summary: remove-word sometimes deletes *following* word
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2004-11-24 15:57 UTC by Jesse Glick
Modified: 2007-11-05 13:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-11-24 15:57:58 UTC
In 041122, I notice that if I have e.g.

  public static class ActionWrapper ...

and I put the caret between the 'c' and ' ' after
'public', remove-word (bound by me to
Ctrl-Backspace) works fine to delete 'public'. But
if I have it one char later, between the ' ' and
's' of 'static', it deletes 'static' instead! This
is most unexpected. It should always delete the
previous word.
Comment 1 Jesse Glick 2004-11-24 15:58:17 UTC
First time I've noticed this bug.
Comment 2 Martin Roskanin 2004-11-24 16:37:49 UTC
new behaviour since bugfix of issue #25662
in accordance with
http://editor.netbeans.org/doc/UserView/apdx_a_eshortcuts.html

if you have situation
public |static  - the word at caret offset is deleted, include the
situation the caret at the begining of the word. That's why "static"
is deleted. Or am I wrong? I just used
Utilities.getIdentifierBlock(doc,dotPos) and the block of the word
"static" was returned.

in this situation public is deleted
public | static

Anyway, fix should be trivial...
Comment 3 Jesse Glick 2004-11-24 20:42:58 UTC
I don't know anything about your UI spec, but every other app has one
behavior for Ctrl-Backspace: it deletes the previous word. And that is
what the editor used to do (if you customized the KB bindings to match
normal usage), and it was fine. The new behavior is confusing.
Ctrl-Delete is supposed to delete the following word, but
Ctrl-Backspace is always supposed to delete the preceding word.
Comment 4 Martin Roskanin 2004-11-29 10:34:15 UTC
Aha. 
Actions remove-word-previous and remove-word-next are not implemented
in NB. You rebinded the action remove-word to CTRL-BACKSPACE key.
I would suggest to create these two missing action with correct
keybindings CTRL+BACKSPACE and CRTL+DELETE.
Any comments?
Comment 5 Martin Roskanin 2004-12-01 14:55:10 UTC
fixed in [maintrunk]

New actions were added:
remove-word-previous with binded CTRL+BACK_SPACE
remove-word-next (CRTL+DELETE)

behaviour of remove-word (CTRL+W) was modified. Action deletes a word
the caret is on. It doesn't remove previous word

Checking in libsrc/org/netbeans/editor/ActionFactory.java;
/cvs/editor/libsrc/org/netbeans/editor/ActionFactory.java,v  <-- 
ActionFactory.java
new revision: 1.59; previous revision: 1.58
done
Checking in libsrc/org/netbeans/editor/BaseKit.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseKit.java,v  <--  BaseKit.java
new revision: 1.125; previous revision: 1.124
done
Checking in libsrc/org/netbeans/editor/Bundle.properties;
/cvs/editor/libsrc/org/netbeans/editor/Bundle.properties,v  <-- 
Bundle.properties
new revision: 1.51; previous revision: 1.50
done
Checking in libsrc/org/netbeans/editor/SettingsDefaults.java;
/cvs/editor/libsrc/org/netbeans/editor/SettingsDefaults.java,v  <-- 
SettingsDefaults.java
new revision: 1.43; previous revision: 1.42
done
Processing log script arguments...
More commits to come...
Checking in
src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml;
/cvs/editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml,v
 <--  DefaultGlobalKeyBindings.xml
new revision: 1.17; previous revision: 1.16
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions43.pass,v
done
Checking in
test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions43.pass;
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions43.pass,v
 <--  testEditActions43.pass
initial revision: 1.1
done
RCS file:
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions44.pass,v
done
Checking in
test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions44.pass;
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions44.pass,v
 <--  testEditActions44.pass
initial revision: 1.1
done
RCS file:
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions45.pass,v
done
Checking in
test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions45.pass;
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions45.pass,v
 <--  testEditActions45.pass
initial revision: 1.1
done
RCS file:
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions46.pass,v
done
Checking in
test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions46.pass;
/cvs/editor/test/qa-functional/data/goldenfiles/editor_actions/EditActionsTest/testEditActions46.pass,v
 <--  testEditActions46.pass
initial revision: 1.1
done
Processing log script arguments...
More commits to come...
Checking in test/qa-functional/src/editor_actions/EditActionsTest.java;
/cvs/editor/test/qa-functional/src/editor_actions/EditActionsTest.java,v
 <--  EditActionsTest.java
new revision: 1.3; previous revision: 1.2
done
Processing log script arguments...
More commits to come...
Checking in test/qa-functional/src/lib/EditorTestCase.java;
/cvs/editor/test/qa-functional/src/lib/EditorTestCase.java,v  <-- 
EditorTestCase.java
new revision: 1.6; previous revision: 1.5
Comment 6 Jesse Glick 2004-12-01 18:03:19 UTC
Much better, thanks! One minor bug in remove-word-previous which I
will file separately.