(string, goal, tabSize)
| 6985 | // The inverse of countColumn -- find the offset that corresponds to |
| 6986 | // a particular column. |
| 6987 | function findColumn(string, goal, tabSize) { |
| 6988 | for (var pos = 0, col = 0;;) { |
| 6989 | var nextTab = string.indexOf("\t", pos); |
| 6990 | if (nextTab == -1) nextTab = string.length; |
| 6991 | var skipped = nextTab - pos; |
| 6992 | if (nextTab == string.length || col + skipped >= goal) |
| 6993 | return pos + Math.min(skipped, goal - col); |
| 6994 | col += nextTab - pos; |
| 6995 | col += tabSize - (col % tabSize); |
| 6996 | pos = nextTab + 1; |
| 6997 | if (col >= goal) return pos; |
| 6998 | } |
| 6999 | } |
| 7000 | |
| 7001 | var spaceStrs = [""]; |
| 7002 | function spaceStr(n) { |
no outgoing calls
no test coverage detected
searching dependent graphs…