Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor should provide option to reformat source #78

Closed
mbaas2 opened this issue Feb 14, 2017 · 11 comments
Closed

Editor should provide option to reformat source #78

mbaas2 opened this issue Feb 14, 2017 · 11 comments

Comments

@mbaas2
Copy link

mbaas2 commented Feb 14, 2017

As ODE did with Edit > Reformat.

@ngn
Copy link
Contributor

ngn commented Feb 14, 2017

There's Preferences>Shortcuts>RD which you can map to a key combination of your choice but it uses RIDE's own formatting - not 100% compatible with the interpreter's.
See also #68

@mbaas2
Copy link
Author

mbaas2 commented Feb 14, 2017

Ok. But, to be honest, it is not really userfriendly (IMHO) to "hide" such functionality in a shortcuts-table somewhere. Can't we have a proper menu which would expose these functions (and possibly even indicate the key-combination that had been assigned to it?)

@ngn
Copy link
Contributor

ngn commented Feb 14, 2017

You can add
Format =RD
somewhere in Preferences>Menu and restart RIDE.
I have no comment on whether that should be the default.

@geoffstreeter
Copy link

geoffstreeter commented Feb 20, 2017

RD from the keyboard does not work. I should not need to mess with preferences for it to do so.

@jayfoad
Copy link
Contributor

jayfoad commented Mar 2, 2017

RIDE should probably copy the ODE's default key binding for RD, which is numeric-keypad-/. Currently RIDE's keyboard shortcut system does not distinguish numeric-keypad-/ from normal /, so it would need a bit of work.

@geoffstreeter
Copy link

geoffstreeter commented Mar 2, 2017 via email

@jayfoad
Copy link
Contributor

jayfoad commented Mar 2, 2017

RIDE should at least honour the users keyboard so that RD (UF819) works

No, as a design decision RIDE does not respond to these Dyalog private-use-area command codes.

@geoffstreeter
Copy link

geoffstreeter commented Mar 2, 2017 via email

@e9gille
Copy link
Contributor

e9gille commented Mar 3, 2017

I have just looked into this and found that the module we use (CodeMirror) is natively not distinguishing between numpad keys and their equivalents.

I've found a way top extend it to do exactly that and set the default shortcut to match the ODE (NumpadDivide). Together with 0eda47c this should now work as requested.

@e9gille e9gille closed this as completed in 3890745 Mar 3, 2017
@ngn
Copy link
Contributor

ngn commented Mar 3, 2017

@geoffstreeter @jayfoad
CodeMirror has two ways to define a mapping: as a combination of keys or as a character.
https://codemirror.net/doc/manual.html#keymaps
Prefs>Shortcuts maps keys.
Separately from that, RIDE maps Dyalog's private-range Unicode chars:

ride/src/km.js

Line 353 in 167f1aa

// 0 1 2 3 4 5 6 7 8 9 A B C D E F

(If you adopt a policy of not supporting the private range, I think that code should be removed.)
However, due to a bug in Chromium, some special key combinations don't produce characters - Chromium hijacks them before xkb has a chance to process them, and they never reach CodeMirror/RIDE. See https://bugs.chromium.org/p/chromium/issues/detail?id=485528#c14

@jayfoad
Copy link
Contributor

jayfoad commented Mar 3, 2017

Separately from that, RIDE maps Dyalog's private-range Unicode chars:

ride/src/km.js

Line 353 in 167f1aa

// 0 1 2 3 4 5 6 7 8 9 A B C D E F

Thanks @ngn. I didn't know about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants