MCPcopy
hub / github.com/nwutils/nw-sample-apps / countColumn

Function countColumn

mini-code-edit/cm/lib/codemirror.js:2919–2929  ·  view source on GitHub ↗
(string, end, tabSize)

Source from the content-addressed store, hash-verified

2917 // Counts the column offset in a string, taking tabs into account.
2918 // Used mostly to find indentation.
2919 function countColumn(string, end, tabSize) {
2920 if (end == null) {
2921 end = string.search(/[^\s\u00a0]/);
2922 if (end == -1) end = string.length;
2923 }
2924 for (var i = 0, n = 0; i < end; ++i) {
2925 if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
2926 else ++n;
2927 }
2928 return n;
2929 }
2930
2931 function computedStyle(elt) {
2932 if (elt.currentStyle) return elt.currentStyle;

Callers 1

codemirror.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected