Skip to content

Commit

Permalink
if there is no current selection then use the whole file
Browse files Browse the repository at this point in the history
  • Loading branch information
mneedham committed May 1, 2013
1 parent c15e365 commit 7c353d2
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 7c353d2

Please sign in to comment.