From 2da75c37bd73d9338ac5eef78f02153dcc9b6126 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 19 May 2017 15:48:27 -0700 Subject: [PATCH] handle surrogate pairs in tooltip cursor_pos --- notebook/static/notebook/js/tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;