From 472fe4c19e35349f7f45e86176db3a0ddc7fef0a Mon Sep 17 00:00:00 2001 From: Matthias BUSSONNIER Date: Fri, 17 Feb 2012 13:27:44 +0100 Subject: [PATCH] fix replace range bug pylab.l would be replace by .l because of a bug in common start finding .l on the fifth position of pylab.start. --- IPython/frontend/html/notebook/static/js/completer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/completer.js b/IPython/frontend/html/notebook/static/js/completer.js index ccc661ca2..82ea8f00a 100644 --- a/IPython/frontend/html/notebook/static/js/completer.js +++ b/IPython/frontend/html/notebook/static/js/completer.js @@ -47,7 +47,7 @@ var IPython = (function(IPython ) { while(s && tem2.indexOf(tem1) == -1){ tem1 = tem1.substring(0, --s); } - if (tem1 == "" ){return null;} + if (tem1 == "" || tem2.indexOf(tem1) != 0){return null;} return { str : tem1, type : "computed", from : B[0].from, @@ -210,7 +210,7 @@ var IPython = (function(IPython ) { //Check that shared start is not null which can append with prefixed completion // like %pylab , pylab have no shred start, and ff will result in py // to erase py - var sh = sharedStart(this.raw_result) + var sh = sharedStart(this.raw_result); if(sh){ this.insert(sh); }