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 114304 - jVi Ctrl-R keybinding lost for some mime-types
Summary: jVi Ctrl-R keybinding lost for some mime-types
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
Depends on: 114747
Blocks:
  Show dependency tree
 
Reported: 2007-08-31 06:21 UTC by err
Modified: 2007-11-05 13:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
grep for in-place-refactoring (2.42 KB, text/plain)
2007-11-04 04:27 UTC, err
Details
grep for key=.D-R (815 bytes, application/octet-stream)
2007-11-04 04:27 UTC, err
Details
grep for key=.D-R (with correct mime type) (815 bytes, text/plain)
2007-11-04 04:29 UTC, err
Details
patch to consistently make in-place-refactoring a keybinding (7.69 KB, patch)
2007-11-04 20:47 UTC, err
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description err 2007-08-31 06:21:53 UTC
Ctrl-R (redo in jVi) is not delivered to jVi in the html editor, I also noticed that it is lost in the Jackpot Rules
editor. Other control keys are not affected; they get delivered to jVi just fine.

Any ideas how I can best track this down?
Comment 1 Vitezslav Stejskal 2007-08-31 12:07:47 UTC
HTML is Schliemann based, I'm not sure about Jackpot Rules, but it is probably Schliemann based too. Java, properties,
plain text are non-schliemann base. Could you please try other schliemann languages, eg. javascript if it works for them
or not? Thanks
Comment 2 err 2007-09-01 22:40:58 UTC
Seems you are on to something about schliemann involved in the problem
Ctrl-R WORKS for plain text, java, xml, properties.
Ctrl-R FAILS for java script, html, jackpot rules
Comment 3 Vitezslav Stejskal 2007-09-05 17:25:49 UTC
Thanks for that. IMO this might be caused by issue #114747, which is caused by broken kitClass -> mime-type translation
for schliemann languages (all using LanguagesEditorKit).
Comment 4 err 2007-11-03 06:28:22 UTC
What are the chances of this being fixed for the 6.0 release?

Can you think of an experiment to check if issue 114747 is indeed related?
Comment 5 Vitezslav Stejskal 2007-11-03 08:25:48 UTC
It sort of is, but could be remedied. I recall fixing similar problem for ctrl+/, which was hardcoded in
LanguagesEditorKit.install() IIRC. I spotted there that LEK also hardcodes ctrl+R for some reason. I'm not sure why, but
LEK needs to install its own action for it and this looks like a hack that they needed to do to make it work. IMO a
solution would be to:

- look to all modules that use ctrl+R and see what action-id they bind it to
- unify that, eg if different modules bind it to different names, choose just one
- add the binding from the editor module for all languages (Editor/Keybindings/Defaults) and remove the biding from all
the other modules. They will still install their own actions for it, which will have to use the unified action-id.
- test the change for languages implemented by the affected modules and of course for jVi

Ernie, the deadline is Sunday night, if you are around and willing to help please start working on it, assign to
yourself and change status to STARTED. Get as far as you can and attach the patch, I'll finish or just review it and
commit. Thanks
Comment 6 err 2007-11-04 04:25:39 UTC
> add the binding from the editor module for all languages (Editor/Keybindings/Defaults)...
I'm assuming this is done by adding the binding to:
    editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml
and NetBeans55-keybindings.xml already has the binding. Is this the only place it needs to be added?

I'm attaching the relevant output from two greps, for
    key=.D-R
    in-place-refactoring
this info looks like enough to make the change. It looks like everything uses the same action-id, so don't have to worry
about that. It shouldn't take too long and I'll do it Sunday morning (GMT-8).

It does seem a little funny to add this to any/all editors, its not like a motion command that makes sense no matter
what you are editting. I guess if the action isn't defined then the binding does nothing?
Comment 7 err 2007-11-04 04:27:02 UTC
Created attachment 52462 [details]
grep for in-place-refactoring
Comment 8 err 2007-11-04 04:27:56 UTC
Created attachment 52463 [details]
grep for key=.D-R
Comment 9 err 2007-11-04 04:29:05 UTC
Created attachment 52464 [details]
grep for key=.D-R (with correct mime type)
Comment 10 Vitezslav Stejskal 2007-11-04 09:33:26 UTC
> I'm assuming this is done by adding the binding to:
>    editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml
>and NetBeans55-keybindings.xml already has the binding. Is this the only place it needs to be added?

Yes, it has to be added to these two profiles. There are other keybinding profiles (Emacs, Eclipse) in ide/defaults
module. I'm not sure if they define it or actually what shortcut they bind to 'in-place-refactoring'.

> It does seem a little funny to add this to any/all editors, its not like a motion command that makes sense no matter
> what you are editting. I guess if the action isn't defined then the binding does nothing?

Correct, not used bindings do nothing. Adding it for all editors is kind of a hack of course. Thanks for your help Ernie.
Comment 11 err 2007-11-04 20:47:59 UTC
Created attachment 52487 [details]
patch to consistently make in-place-refactoring a keybinding
Comment 12 err 2007-11-04 20:52:15 UTC
In addition to default, the keybinding was added to Emacs and Eclipse (they had no D-R (Ctrl-R) keybinding).

Limitted testing. Did not test ruby or ruby's html or java script.

Reassigning to Vita to consider patch.
Comment 13 Vitezslav Stejskal 2007-11-04 21:19:31 UTC
Thanks Ernie, the patch is looking good. I'm going to apply it asap.
Comment 14 Vitezslav Stejskal 2007-11-04 21:54:08 UTC
Applied and commited. Awesome job Ernie, thanks a lot.

Checking in languages/engine/src/org/netbeans/modules/languages/dataobject/LanguagesEditorKit.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/dataobject/LanguagesEditorKit.java,v  <--  LanguagesEditorKit.java
new revision: 1.28; previous revision: 1.27
done
Checking in ruby/rhtml/src/org/netbeans/modules/ruby/rhtml/resources/DefaultKeyBindings.xml;
/cvs/ruby/rhtml/src/org/netbeans/modules/ruby/rhtml/resources/DefaultKeyBindings.xml,v  <--  DefaultKeyBindings.xml
new revision: 1.7; previous revision: 1.6
done
Checking in cnd/refactoring/src/org/netbeans/modules/cnd/refactoring/DefaultKeyBindings.xml;
/cvs/cnd/refactoring/src/org/netbeans/modules/cnd/refactoring/DefaultKeyBindings.xml,v  <--  DefaultKeyBindings.xml
new revision: 1.2; previous revision: 1.1
done
Checking in editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml;
/cvs/editor/src/org/netbeans/modules/editor/resources/NetBeans-keybindings.xml,v  <--  NetBeans-keybindings.xml
new revision: 1.25; previous revision: 1.24
done
Checking in ide/defaults/src/org/netbeans/modules/defaults/Emacs-keybindings.xml;
/cvs/ide/defaults/src/org/netbeans/modules/defaults/Emacs-keybindings.xml,v  <--  Emacs-keybindings.xml
new revision: 1.27; previous revision: 1.26
done
Checking in ide/defaults/src/org/netbeans/modules/defaults/Eclipse-keybindings.xml;
/cvs/ide/defaults/src/org/netbeans/modules/defaults/Eclipse-keybindings.xml,v  <--  Eclipse-keybindings.xml
new revision: 1.20; previous revision: 1.19
done
Checking in java/editor/src/org/netbeans/modules/java/editor/resources/DefaultKeyBindings.xml;
/cvs/java/editor/src/org/netbeans/modules/java/editor/resources/DefaultKeyBindings.xml,v  <--  DefaultKeyBindings.xml
new revision: 1.21; previous revision: 1.20
done
Checking in languages/engine/src/org/netbeans/modules/languages/resources/DefaultKeyBindings.xml;
/cvs/languages/engine/src/org/netbeans/modules/languages/resources/DefaultKeyBindings.xml,v  <--  DefaultKeyBindings.xml
new revision: 1.7; previous revision: 1.6
done
Checking in ruby/editing/src/org/netbeans/modules/ruby/DefaultKeyBindings.xml;
/cvs/ruby/editing/src/org/netbeans/modules/ruby/DefaultKeyBindings.xml,v  <--  DefaultKeyBindings.xml
new revision: 1.13; previous revision: 1.12
done