   func setCursorRange(_ range: NSRange) {
     if range.location != NSNotFound {
       webView!.evaluateJavaScript("setCursorRange(\(range.location),\(range.length));", completionHandler: nil)
+      self.currentCursorRange = range
     }
   }
 

    text = text.replacingOccurrences(of: "\\", with: "\\\\")
    text = text.replacingOccurrences(of: "'", with: "\\'")
    text = text.replacingOccurrences(of: "\n", with: "\\n")
    webView!.evaluateJavaScript("setKeymanVal('\(text)');", completionHandler: nil)
  }
  

  private var bannerImgPath: String = ""

  var isLoading: Bool = false

  private var currentText: String = ""
  private var currentCursorRange: NSRange? = nil

  init(storage: Storage) {
    self.storage = storage
