Skip to content

Commit

Permalink
Merge pull request #1 from mneedham/master
Browse files Browse the repository at this point in the history
If nothing selected use contents of file
  • Loading branch information
avolochenko committed May 1, 2013
2 parents c15e365 + 7c353d2 commit 0efb4d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def run(self, edit):
selections = self.view.sel()

#assing text from selection to the query object
CYPHER_QUERY["query"] = self.view.substr(selections[0])
if self.view.substr(selections[0]):
CYPHER_QUERY["query"] = self.view.substr(selections[0])
else:
CYPHER_QUERY["query"] = self.view.substr(self.view.visible_region())

#convert into proper json
data = json.dumps(CYPHER_QUERY)
Expand Down

0 comments on commit 0efb4d1

Please sign in to comment.