From c805edd25f16b1c7f4cc7c057b457928a8591b54 2013-12-29 16:05:18 From: Matthias Bussonnier Date: 2013-12-29 16:05:18 Subject: [PATCH] Merge pull request #4658 from stevefox/dev Bug fix for #4643: Regex object needs to be reset between calls in toolt... --- diff --git a/IPython/html/static/notebook/js/tooltip.js b/IPython/html/static/notebook/js/tooltip.js index 983aca4..e840184 100644 --- a/IPython/html/static/notebook/js/tooltip.js +++ b/IPython/html/static/notebook/js/tooltip.js @@ -217,6 +217,8 @@ var IPython = (function (IPython) { } // remove everything after last open bracket line = line.replace(endBracket, ""); + // reset the regex object + Tooltip.last_token_re.lastIndex = 0; return Tooltip.last_token_re.exec(line) }; @@ -266,7 +268,9 @@ var IPython = (function (IPython) { this.tabs_functions[this._consecutive_counter](cell, text); // then if we are at the end of list function, reset - if (this._consecutive_counter == this.tabs_functions.length) this.reset_tabs_function (cell, text); + if (this._consecutive_counter == this.tabs_functions.length) { + this.reset_tabs_function (cell, text); + } return; }