 class CompletingControlDelegate: NSObject, NSTextFieldDelegate {
 
     var allowNonMatchingCompletions = true
-    
+    var startsWithMatchOnly         = false
+
     var amCompleting  = false
     var amBackspacing = false
 

        forPartialWordRange charRange: NSRange,
        indexOfSelectedItem index: UnsafeMutablePointer<Int>
    ) -> [String] {
        let input       = control.stringValue
        let currentWord = input.lowercaseString
        
        var completions: [String]

        if currentWord == "?" {
            completions = completionValues
        }
        else {
            completions = []

            if allowNonMatchingCompletions && input.characters.count > 0 {
                completions.append(input)
            }

            for word in completionValues {
                if word.lowercaseString.hasPrefix(currentWord) {
                    completions.append(word)
                }
            }
        }

        if completions.count == 1 {

    
    
    override func controlTextDidChange(notification: NSNotification) {
        let fieldEditor = notification.userInfo?["NSFieldEditor"]

        if amBackspacing {
            amBackspacing = false
            if let fieldEditor = fieldEditor {
                fieldEditor.complete(self)
            }
            return
        }
        
        if !amCompleting {
            guard let fieldEditor = fieldEditor else {
                logError("No field editor?")
                return
            }
