     }
     
     private func removeTextField() {
-        state = .Inactive
         inputTextField.removeFromSuperview()
     }
     

            if let result = labelsController.next(char) {
                removeTextField()
                state = .Inactive
                jump(result)
            }
        default:
            break

        let ranges = currentEditorView.rangesOfVisible(char)
        let rects = ranges.map(currentEditorView.rectFromRange)
        
        if ranges.isEmpty {
            abort()
            return
        } else if ranges.count == 1 {
            jump(ranges.first!)
            state = .Inactive
            removeTextField()
            return
        }
        
        // TODO: Temporary
        if ranges.count >= 26 * 2 {
            abort()
            return
        }
        
        state = .ShowCandidates
        labelsController.initialize(Array(zip(ranges, rects)))
    }
    
    private func abort() {
        state = .Inactive
        removeTextField()
        currentEditorView.window?.makeFirstResponder(currentEditorView)
    }

    private func jump(range: NSRange) {
        currentEditorView.setSelectedRange(range)
        currentEditorView.window?.makeFirstResponder(currentEditorView)
    }
    
