Skip to content

Commit

Permalink
Review actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsteh committed Jun 1, 2017
1 parent a65c5b9 commit 5da54fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/config/configSpec.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
newLaptopKeyboardLayout = boolean(default=false)
[editableText]
caretMoveTimeout = integer(min=0, max=2000, default=100)
caretMoveTimeoutMs = integer(min=0, max=2000, default=100)
""").format(latestSchemaVersion=latestSchemaVersion)

#: The configuration specification
Expand Down
6 changes: 3 additions & 3 deletions source/editableText.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def _hasCaretMoved(self, bookmark, retryInterval=0.01, timeout=None):
@rtype: tuple
"""
if timeout is None:
timeout = config.conf["editableText"]["caretMoveTimeout"]
timeoutMs = config.conf["editableText"]["caretMoveTimeoutMs"]
else:
# This function's arguments are in seconds, but we want ms.
timeout *= 1000
timeoutMs = timeout * 1000
# time.sleep accepts seconds, so retryInterval is in seconds.
# Convert to integer ms to avoid floating point precision errors when adding to elapsed.
retryMs = int(retryInterval * 1000)
Expand All @@ -82,7 +82,7 @@ def _hasCaretMoved(self, bookmark, retryInterval=0.01, timeout=None):
if newBookmark!=bookmark:
log.debug("Caret moved. Elapsed: %d ms" % elapsed)
return (True,newInfo)
if elapsed >= timeout:
if elapsed >= timeoutMs:
break
time.sleep(retryInterval)
elapsed += retryMs
Expand Down

0 comments on commit 5da54fe

Please sign in to comment.