Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If nothing selected use contents of file #1

Merged
merged 1 commit into from
May 1, 2013

Conversation

mneedham
Copy link
Contributor

@mneedham mneedham commented May 1, 2013

Hey,

On some of the SQL editors that I've used the default behaviour is that if you don't select the query then it will use the contents of the current view and execute that as a query.

I found myself expecting this plugin to work like that and it didn't so hence this commit :)

Let me know what you think.
Mark

avolochenko added a commit that referenced this pull request May 1, 2013
If nothing selected use contents of file
@avolochenko avolochenko merged commit 0efb4d1 into avolochenko:master May 1, 2013
@avolochenko
Copy link
Owner

Thanks for the change Mark! It definitely needed that.

@mneedham
Copy link
Contributor Author

mneedham commented May 1, 2013

Cool!

Was looking at the cypher sublime plugin which does the syntax highlighting and it solves the problem slightly differently:

    sels = self.view.sel()

    for sel in sels:
        if sel.size() == 0:
            sel = sublime.Region(0, self.view.size())

        query = self.view.substr(sel)

Maybe cleaner but more code as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants