nedit-ng
nedit-ng copied to clipboard
Add the ability to remap shortcuts
This may end up being very complex to do well, but I think it's a worthy goal. I personally love nedit's keyboard bindings, but if we want to be the best editor possible, we should be able to accommodate other people's preferences.
Hi,
My bindkey for "Comment" was mapped to Alt+z. For ex, I can comment out some selected lines in a Perl or .csh script using it. In the first version of nedit-ng, I couldn't use it as it was mapped to the "Shell => make" command. After I've imported my .nedit/nedit.rc file with nedit-import, this key is no more mapped to "Shell => make" , I can see it in my macro menu but it does not work (nothing happens). The "Uncomment" bindkey (Shift+Alt+z) is working fine. Do you know how I can do the get my "Alt+Z" bindkey work again ?
Regards.
xuo.
Can you set it in the UI correctly?
Hmm, I've noticed a small bug in the UI regarding shortcuts. Let me see if I can make things work as expected...
OK, a bug was fixed involving the Accelerator widget. Previously it would not respect clearing the widget correctly, now it can be done:
When I set the accelerator for make to nothing, and then set the accelerator for "Comment #" to "Alt+Z", it appears to work as expected. Please note, that the default version of this macro requires a selection.
Hi,
I'm currently using the master branch for nedit-ng. I've updated and recompiled but I still have the same problem.
Regards.
Xuo.
Maybe post your config.ini?
Hmm, so looking at your config, it looks like you intended to have Alt+Z bound to "tagstack -> pop tag"; is that correct?
I don't know what this macro does, but I can say that if I add a t_print("MACRO") to the end of that macro, and then use Alt+Z I do see that message in the console.
Can you verify this behavior? If that is the case, is it possible that this is a bug introduced in the macro system that I need to investigate?
Hi,
I've removed the Alt+Z shortcut for "pop tag" in the config.ini file. The Alt+Z bindkey for "comments" now works. If I add it again (Alt+Z for "pop tag"), then the bindkey for "comments" does not work. This was working with the native nedit. But it can be considered as a bug as it means that the same bindkey is linked to 2 different actions. The pop tag was a macro that (if I remeber well) was used when a tag file was loaded. For ex, I could load a Verilog tag file and when I was opening the top file, then I could go down in the hierarchy using the "find tag" macro and go back the the previous hierarchy level (and previous file) using the "pop tag" macro. I don't use it anymore so I can keep the "Alt+Z" bindkey commented out for "pop tag". The diffrenerce between the 2 "Alt+Z" bindkeys behavior was that the one that is bound to the "Comment" needs a selection while the other one do not need any selection (the "find tag" macro needs a selection).
Regards.
Xuo.
Ah, OK. Yea, Qt will not allow the same shortcut on two different enabled actions. I can try to work around this just a little bit by dynamically enabling and disabling actions that require a selection.
Which would probably help in this particular scenario, but fundamentally setting the same shortcut on two different actions is not advisable.
Hi,
So, forget it (for the moment). I couldn't compile nedit-ng at work. Too difficult for me. I'll try to install CentOS 6.6 on some pc and to compile nedit-ng and use the executable at work.
Regards.
Xuo.
Indeed, allowing to remap shortcuts, is useful if you don't like the default. But even more importantly, it is also, I think, the only way to access some NEdit functions which are not mapped at all by default.
As an example, here is the mouse_pan() function mapped to my mouse right click on the X11 version. I see no way to use it right now with nedit-ng:

Right, currently, nedit-ng supports this via Ctrl + Right Click.
I think that Qt might swap Command and Ctrl, so you may want to give Command + (Whatever qualifies as a right-click) to see if you can trigger it that way.
You're damn right :-)