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

Function dedent

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

Source from the content-addressed store, hash-verified

223 }
224
225 function dedent(stream, state) {
226 if (state.scopes.length == 1) return;
227 if (state.scopes[0].type === 'coffee') {
228 var _indent = stream.indentation();
229 var _indent_index = -1;
230 for (var i = 0; i < state.scopes.length; ++i) {
231 if (_indent === state.scopes[i].offset) {
232 _indent_index = i;
233 break;
234 }
235 }
236 if (_indent_index === -1) {
237 return true;
238 }
239 while (state.scopes[0].offset !== _indent) {
240 state.scopes.shift();
241 }
242 return false
243 } else {
244 state.scopes.shift();
245 return false;
246 }
247 }
248
249 function tokenLexer(stream, state) {
250 var style = state.tokenize(stream, state);

Callers 2

tokenBaseFunction · 0.70
tokenLexerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected