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