Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: whitequark/sublime-ocp-index
base: 0291804bf9
...
head fork: whitequark/sublime-ocp-index
compare: f266996473
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Feb 19, 2014
Andrew Herron TheSpyder Sublime word expansion ends with _, so expand the search for type ins…
…pection. Special case for variables ending with _.
18174e7
whitequark Merge pull request #5 from TheSpyder/underscore_type_inspection_fix
Fix for inspecting variables with underscores
f266996
Showing with 8 additions and 2 deletions.
  1. +8 −2 sublime_ocp_index.py
10 sublime_ocp_index.py
View
@@ -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):

No commit comments for this range

Something went wrong with that request. Please try again.