Permalink
Browse files

work around sublime bug with caret position not refreshing

  • Loading branch information...
1 parent 1e9b27b commit 9e6ffbf573fc60b356665ff2ba9ced614c71120f @makc makc committed Dec 18, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 run_with_colt.py
View
@@ -153,6 +153,11 @@ def run(self):
targetView.sel().add(sublime.Region(position))
targetView.show_at_center(position)
+
+ # work around sublime bug with caret position not refreshing
+ bug = [s for s in targetView.sel()]
+ targetView.add_regions("bug", bug, "bug", "dot", sublime.HIDDEN | sublime.PERSISTENT)
+ targetView.erase_regions("bug")
def is_enabled(self):
view = self.window.active_view()

3 comments on commit 9e6ffbf

Contributor

makc replied Dec 19, 2013

Update: only reliably works in ST2 (50/50 success rate in ST3)

@makc - You might want to take a look at the Sublime Text bug report I just made. I think you and I have both encountered the same ST bug from slightly different angles. Thanks for the workaround code - I've altered it a bit and it works consistently for me in ST3. My version of your workaround code is included in a bug demo plugin class posted in the bug report.

Link to: Plugin new selection does not always get updated properly

Contributor

makc replied Sep 18, 2014

@mattst thanks, but I am no longer involved with this repo and/or sublime plugin writing business.

Please sign in to comment.