Comment #2 on issue 2589 by asmeurer: Implement tab completion in SymPy Live
http://code.google.com/p/sympy/issues/detail?id=2589

I applied this change:

diff --git a/static/live-core.js b/static/live-core.js
index 381b44f..1148063 100644
--- a/static/live-core.js
+++ b/static/live-core.js
@@ -485,6 +485,7 @@ SymPy.Shell = Ext.extend(Ext.util.Observable, {
             }

             break;
+        case SymPy.Keys.TAB:
         case SymPy.Keys.ENTER:
             var shiftEnter = (this.submitEl.getValue() == "shift-enter");

which makes Tab act the same as Enter, and tested it in Safari, Chrome, Firefox, and Opera. All stayed in the box (normally Tab would move to the "Evaluate" botton). Obviously, I couldn't test this in Internet Explorer. Note that some websites to use Tab, such as Google Docs.

If you want, you could add a checkbox to disable tab completion, but I actually don't see a problem with just enabling it, and if it doesn't work, then it is no big deal, just don't use it (or get a better browser). It's not like it will break anything if Tab doesn't move to the next field (except maybe some kind of accessibility issues; I'm not really sure about that, but then, our difficulty of use in mobile browsers shows how poor our "accessibility" already is).

As far as the other stuff, there is code that does it all in the readline library (see e.g., the docstring of rlcompleter). I don't know if it can be just copied over because of licensing issues (it's GPL, isn't it?), but it could at least be inspiration.

I think just printing it to the console would be fine. This is what Python and IPython interactive terminals do, and Live is supposed to emulate those.

Do not the web browsers include built-in mechanics for text wrapping? Or again, we could just say that if a browser doesn't support text wrapping (like Firefox), then the user who chooses to use that browser will have to deal with it.

By the way, I noticed some bugs in Opera, which I will open a new issue for.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to