MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / countColumn

Function countColumn

static/js/codemirror/codemirror.js:4923–4933  ·  view source on GitHub ↗
(string, end, tabSize)

Source from the content-addressed store, hash-verified

4921 // Counts the column offset in a string, taking tabs into account.
4922 // Used mostly to find indentation.
4923 function countColumn(string, end, tabSize) {
4924 if (end == null) {
4925 end = string.search(/[^\s\u00a0]/);
4926 if (end == -1) end = string.length;
4927 }
4928 for (var i = 0, n = 0; i < end; ++i) {
4929 if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
4930 else ++n;
4931 }
4932 return n;
4933 }
4934 CodeMirror.countColumn = countColumn;
4935
4936 var spaceStrs = [""];

Callers 3

findStartLineFunction · 0.85
indentLineFunction · 0.85
codemirror.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected