                 var line = editor.state.search.posFrom.line
                 var ch = editor.state.search.posFrom.ch
                 window.webkit.messageHandlers.\(messageHandlerKeyCurrentSearchLocation).postMessage({'\(cursorLineKey)': line, '\(cursorCharacterKey)': ch})
+                true
             """) { (result, error) in
                 
                 currentSearchLocationExpectation.fulfill()

        userContentController.add(self, name: messageHandlerKeyReplace)
        
        webView.evaluateJavaScript("""
            var replaceText = editor.getRange({line: \(newLocationFrom.line), ch: \(newLocationFrom.ch)}, {line: \(newLocationTo.line), ch: \(newLocationTo.ch)})
                window.webkit.messageHandlers.\(messageHandlerKeyReplace).postMessage(replaceText)
            """) { (result, error) in
                
                replacedTextExpectation.fulfill()

                var line = editor.state.search.posTo.line
                var ch = editor.state.search.posTo.ch
                window.webkit.messageHandlers.\(messageHandlerKeyCurrentSearchLocation).postMessage({'\(cursorLineKey)': line, '\(cursorCharacterKey)': ch})
                true
            """) { (result, error) in
                
                currentSearchLocationExpectation.fulfill()
