diff --git a/notebook/static/notebook/js/tooltip.js b/notebook/static/notebook/js/tooltip.js index ba93a1d9c..c0d7e11e1 100644 --- a/notebook/static/notebook/js/tooltip.js +++ b/notebook/static/notebook/js/tooltip.js @@ -201,8 +201,8 @@ define([ this.cancel_pending(); var editor = cell.code_mirror; var cursor = editor.getCursor(); - var cursor_pos = editor.indexFromPos(cursor); var text = cell.get_text(); + var cursor_pos = utils.js_idx_to_char_idx(editor.indexFromPos(cursor), text); this._hide_if_no_docstring = hide_if_no_docstring;