MCPcopy
hub / github.com/csev/py4e / countColumn

Function countColumn

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:3119–3129  ·  view source on GitHub ↗
(string, end, tabSize)

Source from the content-addressed store, hash-verified

3117 // Counts the column offset in a string, taking tabs into account.
3118 // Used mostly to find indentation.
3119 function countColumn(string, end, tabSize) {
3120 if (end == null) {
3121 end = string.search(/[^\s\u00a0]/);
3122 if (end == -1) end = string.length;
3123 }
3124 for (var i = 0, n = 0; i < end; ++i) {
3125 if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
3126 else ++n;
3127 }
3128 return n;
3129 }
3130
3131 function computedStyle(elt) {
3132 if (elt.currentStyle) return elt.currentStyle;

Callers 6

codemirrorepl.jsFile · 0.70
findStartLineFunction · 0.70
posFromMouseFunction · 0.70
extendToFunction · 0.70
indentLineFunction · 0.70
codemirror.jsFile · 0.70

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected