mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
If all the previous line characters are tab, don't show autocomplete on tab
This commit is contained in:
parent
655ba8881e
commit
5f4d81cf07
1 changed files with 4 additions and 2 deletions
|
|
@ -839,11 +839,13 @@ function ParagraphCtrl ($scope, $rootScope, $route, $window, $routeParams, $loca
|
|||
sender: 'editor|cli'
|
||||
},
|
||||
exec: function(env, args, request) {
|
||||
let iColumnPosition = $scope.editor.selection.getCursor().column
|
||||
let iCursor = $scope.editor.getCursorPosition()
|
||||
let currentLine = $scope.editor.session.getLine(iCursor.row)
|
||||
let isAllTabs = currentLine.split('').every(function(char) { return (char === '\t' || char === ' ') })
|
||||
|
||||
// If user has pressed tab on first line char or if editor mode is %md, keep existing behavior
|
||||
// If user has pressed tab anywhere in between and editor mode is not %md, show autocomplete
|
||||
if (iColumnPosition && $scope.paragraph.config.editorMode !== 'ace/mode/markdown') {
|
||||
if (!isAllTabs && iCursor.column && $scope.paragraph.config.editorMode !== 'ace/mode/markdown') {
|
||||
$scope.editor.execCommand('startAutocomplete')
|
||||
} else {
|
||||
ace.config.loadModule('ace/ext/language_tools', function () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue