(string, end, tabSize, startIndex, startValue)
| 671 | // Counts the column offset in a string, taking tabs into account. |
| 672 | // Used mostly to find indentation. |
| 673 | function countColumn(string, end, tabSize, startIndex, startValue) { |
| 674 | if (end == null) { |
| 675 | end = string.search(/[^\s\u00a0]/) |
| 676 | if (end == -1) { |
| 677 | end = string.length |
| 678 | } |
| 679 | } |
| 680 | for (var i = startIndex || 0, n = startValue || 0; ; ) { |
| 681 | var nextTab = string.indexOf("\t", i) |
| 682 | if (nextTab < 0 || nextTab >= end) { |
| 683 | return n + (end - i) |
| 684 | } |
| 685 | n += nextTab - i |
| 686 | n += tabSize - (n % tabSize) |
| 687 | i = nextTab + 1 |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | var Delayed = function () { |
| 692 | this.id = null |
no test coverage detected