Skip to content
Browse files

Sublime word expansion ends with _, so expand the search for type ins…

…pection. Special case for variables ending with _.
  • Loading branch information...
1 parent 0291804 commit 18174e79c13f8966f1a73dd0fc5310304c524c8f @TheSpyder TheSpyder committed Feb 19, 2014
Showing with 8 additions and 2 deletions.
  1. +8 −2 sublime_ocp_index.py
View
10 sublime_ocp_index.py
@@ -84,6 +84,11 @@ def extract_query(self, view, location):
def query_type(self, view, location):
endword = view.word(location).end()
+ while view.substr(endword) is '_':
+ endword = endword + 1
+ if view.substr(endword) is not ' ':
+ endword = view.word(endword).end()
+
query = self.extract_query(view, endword)
if query is not None:
@@ -94,7 +99,7 @@ def query_type(self, view, location):
if (result is None or len(result) == 0):
return "Unknown type: '%s'" % queryString
else:
- return result
+ return "Type: %s" % result
def query_completions(self, view, prefix, location):
@@ -182,7 +187,8 @@ def run(self, enable):
result = sublimeocp.query_type(self.view, locations[0])
- self.view.set_status(OCPKEY,"Type: " + result)
+ if result is not None:
+ self.view.set_status(OCPKEY, result)
# ST2 backwards compatibility
if (int(sublime.version()) < 3000):

0 comments on commit 18174e7

Please sign in to comment.
Something went wrong with that request. Please try again.