(string, end, tabSize)
| 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 = [""]; |
no outgoing calls
no test coverage detected