 
 
 
+// MARK: -
+
+private class LineCounter: LineRangeCacheable {
+    
+    let string: String
+    var lineStartIndexes = IndexSet()
+    var firstLineUncoundedIndex = 0
+    
+    
+    init(_ string: String) {
+        
+        self.string = string
+    }
+    
+}
+
+
+
 // MARK: - UserDefaults
 
 private extension UserDefaults {

        textView.isEditable = false
        
        let highlightColors = NSColor.textHighlighterColors(count: textFind.numberOfCaptureGroups + 1)
        let lineRegex = try! NSRegularExpression(pattern: "\n")
        
        // setup progress sheet
        let progress = TextFindProgress(format: .find)

                    let matchedRange = matches[0]
                    
                    // calculate line number
                    let lineNumber = lineCounter.lineNumber(at: matchedRange.location)
                    
                    // build a highlighted line string for result table
                    let lineRange = (textFind.string as NSString).lineRange(for: matchedRange)
