Typing foo?? in sage displays the source code of the foo command. This doesn't work in cantor, since it converts it to help(foo?), which gives an error.
foo?? displays the source code of foo, foo? displays help for foo as before
Hi, thanks for patch.
I am afraid, that @filipesaraiva don't active in Cantor in this moment, so I recommend change @filipesaraiva to @asemke: another active Cantor developer.
What about removing this if condtions at all?
- if(command.endsWith(QLatin1Char('?')) && !command.endsWith(QLatin1String("??"))) - command=QLatin1String("help(")+command.left(command.size()-1)+QLatin1Char(')'); - if(command.startsWith(QLatin1Char('?'))) - command=QLatin1String("help(")+command.mid(1)+QLatin1Char(')');
As I see, this code don't need, because sage understand foo? and ?foo as help request, so we don't need change foo? and ?foo to help(foo) command. And this also make the source code command (foo??) working.
Yeah I didn't want to touch that as I assumed it was there for some reason. From a quick look, with those lines help text seems to be displayed in a sllightly more user-friendly way: A first line is added with "Help for foo" and some technical snippets are removed from the top and bottom.