jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/355209 )

Change subject: Map tab key to indent with spaces.
......................................................................


Map tab key to indent with spaces.

Change-Id: I23d7f23c2afd19fbe3fc04cdaaf41cee5422dc04
---
M wikibase/queryService/ui/editor/Editor.js
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  Lucas Werkmeister (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wikibase/queryService/ui/editor/Editor.js 
b/wikibase/queryService/ui/editor/Editor.js
index 7e1e2f2..4681951 100644
--- a/wikibase/queryService/ui/editor/Editor.js
+++ b/wikibase/queryService/ui/editor/Editor.js
@@ -101,6 +101,7 @@
                this._rdfTooltip.setEditor( this._editor );
 
                this._registerHints();
+               this._mapTabToSpaceIndent();
        };
 
        SELF.prototype._registerHints = function() {
@@ -128,6 +129,15 @@
                CodeMirror.hint.sparql.async = true;
        };
 
+       SELF.prototype._mapTabToSpaceIndent = function() {
+               this._editor.setOption( 'extraKeys', {
+                       Tab: function( cm ) {
+                               var spaces = Array( cm.getOption( 'indentUnit' 
) + 1 ).join( ' ' );
+                               cm.replaceSelection( spaces );
+                       }
+               } );
+       };
+
        SELF.prototype._getHints = function( editorContent, lineContent, 
lineNum, cursorPos ) {
                var deferred = new $.Deferred(),
                        self = this;

-- 
To view, visit https://gerrit.wikimedia.org/r/355209
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I23d7f23c2afd19fbe3fc04cdaaf41cee5422dc04
Gerrit-PatchSet: 4
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jakob <[email protected]>
Gerrit-Reviewer: Jakob <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to