From c152d3f62e67cd41026673471418b4cb219b355e Mon Sep 17 00:00:00 2001 From: linquize Date: Mon, 25 Feb 2019 09:19:53 +0800 Subject: [PATCH] fix(stacks): update web editor to set tab key to insert spaces (#2735) --- app/portainer/services/codeMirror.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/portainer/services/codeMirror.js b/app/portainer/services/codeMirror.js index a6e43f11e..731f02c74 100644 --- a/app/portainer/services/codeMirror.js +++ b/app/portainer/services/codeMirror.js @@ -11,7 +11,13 @@ angular.module('portainer.app') var codeMirrorYAMLOptions = { mode: 'text/x-yaml', gutters: ['CodeMirror-lint-markers'], - lint: true + lint: true, + extraKeys: { + Tab: function(cm) { + var spaces = Array(cm.getOption('indentUnit') + 1).join(' '); + cm.replaceSelection(spaces); + } + } }; service.applyCodeMirrorOnElement = function(element, yamlLint, readOnly) {