From 89b7d96ccd87d03226b7977b469e69172c39ef0e Mon Sep 17 00:00:00 2001 From: marcelo-ramires Date: Wed, 2 Dec 2015 00:18:33 -0200 Subject: [PATCH] Fixing way in which selection ranges are deleted --- notebook/static/notebook/js/codecell.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 42e693eed..c75ebd9e0 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -53,8 +53,9 @@ define([ if (sel) { var ranges = cm.listSelections(); for (var i = ranges.length - 1; i >= 0; i--) { - var cur = ranges[i].head; - cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1)); + var head = ranges[i].head; + var anchor = ranges[i].anchor; + cm.replaceRange("", Pos(head.line, head.ch), CodeMirror.Pos(anchor.line, anchor.ch)); } return; }