Don't position caret if there is selection on page

This commit is contained in:
Artur Shaik 2015-06-18 19:47:33 +06:00 committed by Florian Bruhin
parent e2c375b874
commit 94d394001e

View File

@ -467,8 +467,9 @@ class WebView(QWebView):
# and refocusing it fixes that.
self.clearFocus()
self.setFocus(Qt.OtherFocusReason)
self.page().currentFrame().evaluateJavaScript(
utils.read_file('javascript/position_caret.js'))
if len(self.page().selectedText()) == 0:
self.page().currentFrame().evaluateJavaScript(
utils.read_file('javascript/position_caret.js'))
@pyqtSlot(usertypes.KeyMode)
def on_mode_left(self, mode):