-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Arrays, Enter and Intuition #225
Comments
Hmmm... I can see that the current behavior could be unexpected. I'm not sure what's the best way to improve it, though. First, the example you provide with "sin()" is interesting. This is triggered because when inside a parenthesized expression, return/tab are treated as commands to add rows/columns. But that doesn't really make sense here, since it's a scalar argument. So, that should probably be special cased. Second, I'm not sure what you mean by "commit". Do you mean losing the focus? But then having no focus? That doesn't seem to be very useful. Also, you may already know this, but it is currently possible to intercept and handle return in any way you'd like, by specifying a That same handler can be used to redefine the keyboard shortcuts to add a column and row. I'll give it some more thoughts... |
Sorry yes to be clear. Generally, I use mathlive to drive an external equation renderer, and when I press enter (or return), it means; I'm done typing :P I know that I can intercept the handler, but it would be nice to have reasonable default behaviour. I can see the reason enter was used to mean new line, but should rows in a matrix/array really be treated as "new lines" The control comma keyboard shortcut to add a new column to matrices / arrays was also really unintuitive and I had to go digging through the docs to work it out :P. It would generally be a good idea to use conventions that people are already familiar with (or to expose keyboard shortcuts as an object that can be remapped at run-time) |
Also, you're right about losing focus. That's probably a step too far for default behaviour. In my use case it makes sense, but as default behaviour; you're right that probably shouldn't be the way it works. So let me amend that
|
@SAVIAN: fair enough about the shortcuts. I picked the ones used by Excel/Google Sheets. Maybe we need to find better ones... |
I think the comma and semicolon are pretty common. That would be my suggestion :p |
Added In addition, a The event previously named This mimics the behavior of Changed the keyboard shortcuts to add columns and rows:
Note that Enter/Return no longer create a matrix/vector when inside a parenthesized expression. Use ctrl/cmd + Return/Enter instead. Added a |
Describe the bug
I can't call it a bug, but I did test it on a few people, and I believe the current behaviour is too complicated and unintuitive for most users. Basically, when a user hits enter, they are marking the "end" of an input.
Perhaps instead of using the key to make new rows in an array, we should just go with the latex shortcuts that most people editing matrices will be familiar with (
&
) and (\\
). Alternatively, the matlab shortcuts also seem like a good fit (,
for new column and;
for new row).I noticed a few confused faces on some of the examples below:
To Reproduce
In a mathlive document, type
s i n ( 3 <enter>
This will create an array inside of sin
Expected behavior
Pressing enter at that location should have removed focus from the editor.
I propose that:
Environment
Any (but I'm on a mac)
The text was updated successfully, but these errors were encountered: