MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / indent

Function indent

mini-code-edit/cm/mode/coffeescript/coffeescript.js:206–223  ·  view source on GitHub ↗
(stream, state, type)

Source from the content-addressed store, hash-verified

204 }
205
206 function indent(stream, state, type) {
207 type = type || 'coffee';
208 var indentUnit = 0;
209 if (type === 'coffee') {
210 for (var i = 0; i < state.scopes.length; i++) {
211 if (state.scopes[i].type === 'coffee') {
212 indentUnit = state.scopes[i].offset + conf.indentUnit;
213 break;
214 }
215 }
216 } else {
217 indentUnit = stream.column() + stream.current().length;
218 }
219 state.scopes.unshift({
220 offset: indentUnit,
221 type: type
222 });
223 }
224
225 function dedent(stream, state) {
226 if (state.scopes.length == 1) return;

Callers 1

tokenLexerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected