Skip to content

Commit

Permalink
Remove indentation for Pascal mode again
Browse files Browse the repository at this point in the history
(Understanding block structure apparently requires non-trivial parsing for this
language)
  • Loading branch information
marijnh committed Sep 19, 2011
1 parent 9a98950 commit 6889665
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions mode/pascal/pascal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CodeMirror.defineMode("pascal", function(config) {
var keywords = words("and array begin case const div do downto else end file for forward integer " +
"boolean char function goto if in label mod nil not of or packed procedure " +
"program record repeat set string then to type until var while with");
var blockKeywords = words("case do else for if switch while struct");
var blockKeywords = words("case do else for if switch while struct then of");
var atoms = {"null": true};

var isOperatorChar = /[+\-*&%=<>!?|\/]/;
Expand Down Expand Up @@ -131,18 +131,6 @@ CodeMirror.defineMode("pascal", function(config) {
return style;
},

indent: function(state, textAfter) {
if (state.tokenize != null) return 0;
var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
var closing = firstChar == ctx.type || /^(?:end|until|else|elsif|when)\b/.test(textAfter);
if (ctx.type == "statement") {
if (closing) ctx = ctx.prev;
else return ctx.indented + config.indentUnit;
}
if (ctx.align) return ctx.column + (closing ? 0 : 1);
return ctx.indented + (closing ? 0 : config.indentUnit);
},

electricChars: "{}"
};
});
Expand Down

0 comments on commit 6889665

Please sign in to comment.