Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ensure non-floats are passed to sublime.Region

  • Loading branch information...
commit 90e2365182e9566b2fa79dd7dc79d6b0d7e433f6 1 parent 9dfabce
@rctay authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 pipe_views.py
View
7 pipe_views.py
@@ -113,6 +113,13 @@ def run(self, edit):
class ContentReplace(sublime_plugin.TextCommand):
def run(self, edit, start, end, text):
+ # On Sublime Text 2 32-bit (on 64-bit??),
+ # - run_command() converts start/end to floats; and
+ # - sublime.Region() does not accept floats
+ # Together these causes Region() to fail; hence the cast.
+ #
+ # int() instead of long() since Python 3 does not have the latter
+ start = int(start); end = int(end)
region = sublime.Region(start, end)
self.view.replace(edit, region, text)
Please sign in to comment.
Something went wrong with that request. Please try again.