From b3bf9dc3181fb9300114b2b080a5cf82e050cf74 Mon Sep 17 00:00:00 2001 From: Juergen Hasch Date: Wed, 4 Feb 2015 20:56:37 +0100 Subject: [PATCH] Make shift-tab work as "indent-less" operation, too --- IPython/html/static/notebook/js/codecell.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js index fbf3cb049..10c8bfdbd 100644 --- a/IPython/html/static/notebook/js/codecell.js +++ b/IPython/html/static/notebook/js/codecell.js @@ -339,6 +339,12 @@ define([ return false; } } + var pre_cursor = editor.getRange({line:cur.line,ch:0},cur); + if (pre_cursor.trim() === "") { + // Don't show tooltip if the part of the line before the cursor + // is empty. In this case, let CodeMirror handle indentation. + return false; + } this.tooltip.request(that); event.codemirrorIgnore = true; event.preventDefault();