Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 0ce02b4

Browse files
committed
Add comments to insertContent
1 parent 71ac4a2 commit 0ce02b4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

SQLTools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,15 @@ def toNewTab(content, name="", suffix="SQLTools Saved Query"):
141141

142142
def insertContent(content):
143143
view = View()
144+
# getting the settings local to this view/tab
144145
settings = view.settings()
146+
# saving the original settings for "auto_indent", or True if none set
145147
autoIndent = settings.get('auto_indent', True)
148+
# turn off automatic indenting otherwise the tabbing of the original
149+
# string is not respected after a newline is encountered
146150
settings.set('auto_indent', False)
147151
view.run_command('insert', {'characters': content})
152+
# restore "auto_indent" setting
148153
settings.set('auto_indent', autoIndent)
149154

150155

0 commit comments

Comments
 (0)