| 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; |