MCPcopy Index your code
hub / github.com/csev/py4e / countColumn

Function countColumn

tools/pythonauto/static/codemirror/codemirror.js:5585–5595  ·  view source on GitHub ↗
(string, end, tabSize, startIndex, startValue)

Source from the content-addressed store, hash-verified

5583 // Counts the column offset in a string, taking tabs into account.
5584 // Used mostly to find indentation.
5585 function countColumn(string, end, tabSize, startIndex, startValue) {
5586 if (end == null) {
5587 end = string.search(/[^\s\u00a0]/);
5588 if (end == -1) end = string.length;
5589 }
5590 for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {
5591 if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
5592 else ++n;
5593 }
5594 return n;
5595 }
5596 CodeMirror.countColumn = countColumn;
5597
5598 var spaceStrs = [""];

Callers 3

findStartLineFunction · 0.70
indentLineFunction · 0.70
codemirror.jsFile · 0.70

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected