mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-01-05 03:30:20 -05:00
Avoid unnecessary selection change events
This commit is contained in:
parent
3d685b46b9
commit
9b79b12239
@ -186,6 +186,8 @@ def move_end_of_selection(pos, start):
|
||||
if p:
|
||||
r = sel.getRangeAt(0)
|
||||
if start:
|
||||
r.setStart(p.offsetNode, p.offset)
|
||||
if r.startContainer is not p.offsetNode or r.startOffset is not p.offset:
|
||||
r.setStart(p.offsetNode, p.offset)
|
||||
else:
|
||||
r.setEnd(p.offsetNode, p.offset)
|
||||
if r.endContainer is not p.offsetNode or r.endOffset is not p.offset:
|
||||
r.setEnd(p.offsetNode, p.offset)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user