Skip to content

Commit a75f0fe

Browse files
committed
Improved the first character check logic
1 parent 77b47b6 commit a75f0fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ function ParagraphCtrl ($scope, $rootScope, $route, $window, $routeParams, $loca
868868
exec: function(env, args, request) {
869869
let iCursor = $scope.editor.getCursorPosition()
870870
let currentLine = $scope.editor.session.getLine(iCursor.row)
871-
let isAllTabs = currentLine.split('').every(function(char) { return (char === '\t' || char === ' ') })
871+
let isAllTabs = currentLine.substring(0, iCursor.column - 1).split('').every(function(char) { return (char === '\t' || char === ' ') })
872872

873873
// If user has pressed tab on first line char or if editor mode is %md, keep existing behavior
874874
// If user has pressed tab anywhere in between and editor mode is not %md, show autocomplete

0 commit comments

Comments
 (0)