From 36c166b9ed011d28cd4bd3a5991ca06d279a78b5 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 3 Jun 2013 14:44:57 +0400 Subject: [PATCH] force using tabs in makefile and snippets modes --- lib/ace/edit_session.js | 3 ++- lib/ace/mode/makefile.js | 4 +++- lib/ace/mode/snippets.js | 4 +--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index c8cb43ff..4f9ace1f 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -461,7 +461,8 @@ var EditSession = function(text, mode) { * @returns {Boolean} **/ this.getUseSoftTabs = function() { - return this.$useSoftTabs; + // todo might need more general way for changing settings from mode, but this is ok for now + return this.$useSoftTabs && !this.$mode.$indentWithTabs; }; /** * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. diff --git a/lib/ace/mode/makefile.js b/lib/ace/mode/makefile.js index a54171dd..e51a22bb 100644 --- a/lib/ace/mode/makefile.js +++ b/lib/ace/mode/makefile.js @@ -57,7 +57,9 @@ oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "#"; + this.lineCommentStart = "#"; + this.$indentWithTabs = true; + }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/snippets.js b/lib/ace/mode/snippets.js index d3e51863..ed394c8a 100644 --- a/lib/ace/mode/snippets.js +++ b/lib/ace/mode/snippets.js @@ -105,9 +105,7 @@ var Mode = function() { oop.inherits(Mode, TextMode); (function() { - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; + this.$indentWithTabs = true; }).call(Mode.prototype); exports.Mode = Mode;