diff --git a/IPython/frontend/html/notebook/static/css/notebook.css b/IPython/frontend/html/notebook/static/css/notebook.css index d7ea21d5d..52b35c9a0 100644 --- a/IPython/frontend/html/notebook/static/css/notebook.css +++ b/IPython/frontend/html/notebook/static/css/notebook.css @@ -419,6 +419,11 @@ div.text_cell_render { min-height:50px; } +/*fixed part of the completion*/ +.completions p b{ + font-weight:bold; +} + .completions p{ background: #DDF; /*outline: none; diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index f8ac38f5f..e34bb6991 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -218,7 +218,7 @@ var IPython = (function (IPython) { tooltip.append(expandlink); tooltip.append(morelink); if(defstring){ - defstring_html= $('
').html(utils.fixConsole(defstring));
+            defstring_html = $('
').html(utils.fixConsole(defstring));
             tooltip.append(defstring_html);
         }
         tooltip.append(pre);
@@ -241,12 +241,23 @@ var IPython = (function (IPython) {
         var key = { tab:9,
                     esc:27,
                     backspace:8,
-                    space:13,
+                    space:32,
                     shift:16,
-                    enter:32,
-                    // _ is 189
+                    enter:13,
+                    // _ is 95
                     isCompSymbol : function (code)
-                        {return ((code>64 && code <=122)|| code == 189)}
+                        {
+                        return (code > 64 && code <= 90)
+                            || (code >= 97 && code <= 122)
+                            || (code == 95)
+                        },
+                    dismissAndAppend : function (code)
+                        {
+                        chararr = '()[]+-/\\. ,=*'.split("");
+                        codearr = chararr.map(function(x){return x.charCodeAt(0)});
+                        return jQuery.inArray(code, codearr) != -1;
+                        }
+
                     }
 
         // smart completion, sort kwarg ending with '='
@@ -255,25 +266,26 @@ var IPython = (function (IPython) {
         {
             kwargs = new Array();
             other = new Array();
-            for(var i=0;i"+matched_text+""+typed_text.substr(matched_text.length));
+            select = $('#asyoutypeselect');
+            for (var i = 0; i').html(matches[i]));
             }
             select.children().first().attr('selected','true');
@@ -374,7 +393,7 @@ var IPython = (function (IPython) {
         // create html for completer
         var complete = $('
').addClass('completions'); complete.attr('id','complete'); - complete.append($('

').attr('id', 'asyoutype').html(matched_text));//pseudo input field + complete.append($('

').attr('id', 'asyoutype').html('fixed partuser part'));//pseudo input field var select = $('