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

Issue244: GetDefaultEntry returns first expression, without semicolon #245

Merged
merged 3 commits into from
Jan 15, 2013

Conversation

dilijev
Copy link
Collaborator

@dilijev dilijev commented Jan 9, 2013

From #244

When GUI commands choose which expression to use (Plot2d..., Simplify...) etc, and a cell is active but no selection is made, GetDefaultEntry would copy the entire text of the active cell, but this always wrong because it includes the semicolon or dollar sign, which causes a syntax error.

This patch fixes this issue, as well as only allowing the first expression in a cell to be copied in, because these functions cannot deal with multiple expressions either.

@dilijev
Copy link
Collaborator Author

dilijev commented Jan 14, 2013

@andrejv

The fix I made will work in all cases where the cell in question contains one statement, examples:

x+1;
y+2$

However if the cell includes more than one statement, examples:

x+1; y+2$
x+1$ y+2;

The only input that will be copied is that up to the first ; or $, in both examples above: x+1

The patch still improves the behavior to prevent errors, but I wonder what the user will think happened to the rest of the input. Would they expect the same operation to be executed on both inputs in the cell? If so, what should the interface look like for that? Should we launch e.g. the Plot2d dialog once for each input? Should we display the input as shown in the cell, and then evaluate the function once for each input that was in that cell?

Alternatively, should the expression that is chosen be the one that is first in the cell, or the one that the cursor is within? Consider the examples above, if the cursor is located within the second expression, should that expression, y+2, be selected, or should the first expression in the cell be selected? Which is more logical? Which is more natural?

Since selecting the first expression, regardless of cursor position, was a bit easier to implement, the patch includes a fix which exhibits that behavior, but the actual functionality of the feature is, IMO, up for discussion.

andrejv added a commit that referenced this pull request Jan 15, 2013
Issue244: GetDefaultEntry returns first expression, without semicolon
@andrejv andrejv merged commit b0e0b88 into wxMaxima-developers:master Jan 15, 2013
@dilijev dilijev deleted the issue244 branch January 19, 2013 19:51
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

Successfully merging this pull request may close these issues.

2 participants