mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

Add List and Insert Saved Queries #134

Closed Coteh closed 7 years ago

Coteh commented 7 years ago

As described in issue #126, added the ability to insert saved queries directly into existing tab at the current selection(s). Try it out and let me know what you think. I'll update the website once the green light is given.

This new feature expands the st_list_queries command to take a new argument for mode: "insert" which will perform the insertion of a selected saved query. The keybind for this feature is currently mapped to Ctrl+E, Ctrl+I.

tkopets commented 7 years ago

Nice job, overall the code looks good to me. I have one minor ask for you to comment the code of insertContent(content) function, especially the fact of ignoring the indentation setting, setting and restoring the auto_indent param.

Coteh commented 7 years ago

Just left my comments onto the function. Wanted to stress the point that calling settings() on the View object will return the settings local to that view, as per the docs:

"Returns a reference to the view's settings object. Any changes to this settings object will be private to this view."

With that being said, when we made the change to the "auto_indent" setting, it was only for that particular command being called then the original setting is restored in-place.

tkopets commented 7 years ago

Using settings local to current view is an elegant solution. Great job and thank you for this pull request!

tkopets commented 7 years ago

Fixes #126