Skip to content

Commit

Permalink
improved add import behaviour: stay on same line
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianEberius committed Oct 13, 2010
1 parent e41cf3a commit 8ba07b3
Show file tree
Hide file tree
Showing 59 changed files with 12 additions and 6 deletions.
13 changes: 10 additions & 3 deletions Commands/Find Imports.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<string>saveModifiedFiles</string>
<key>command</key>
<string>refactor.py find_imports
</string>
<string>in=`cat -`
out=`echo "$in" | refactor.py find_imports`
if [ "$in" != "$out" ]
then
open "txmt://open/?line=$(($TM_LINE_NUMBER + 1))&amp;column=4"
fi
echo "$out"</string>
<key>input</key>
<string>document</string>
<key>keyEquivalent</key>
Expand Down
4 changes: 2 additions & 2 deletions Support/bin/refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def find_last_import_line(lines):
try:
proposals = complete_import(context.project, context.resource, context.input, offset)
if len(proposals) == 0:
tooltip("No completions found!")
#tooltip("No completions found!")
return context.input
else:
register_completion_images()
Expand Down Expand Up @@ -249,7 +249,7 @@ def find_last_import_line(lines):
lines = code.split("\n")
idx = find_last_import_line(lines)
new_line = "from "+import_from_mod_name+" import "+import_name
tooltip("Added \""+new_line+"\"at line "+str(idx+2))
#tooltip("Added \""+new_line+"\"at line "+str(idx+2))
lines = lines[:idx+1]+[new_line]+lines[idx+1:]
result = "\n".join(lines)
except Exception, e:
Expand Down
Binary file modified Support/lib/rope/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/arguments.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/ast.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/astutils.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/builtins.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/change.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/codeanalyze.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/evaluate.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/exceptions.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/fscommands.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/history.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/libutils.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/doa.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/memorydb.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/objectdb.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/objectinfo.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/soa.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/soi.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/oi/transform.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/prefs.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/project.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pycore.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pynames.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pynamesdef.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pyobjects.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pyobjectsdef.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/pyscopes.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/resourceobserver.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/resources.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/simplify.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/stdmods.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/taskhandle.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/utils.pyc
Binary file not shown.
Binary file modified Support/lib/rope/base/worder.pyc
Binary file not shown.
Binary file modified Support/lib/rope/contrib/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/contrib/codeassist.pyc
Binary file not shown.
Binary file modified Support/lib/rope/contrib/fixsyntax.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/extract.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/functionutils.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/importutils/__init__.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/importutils/actions.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/importutils/importinfo.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/importutils/module_imports.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/occurrences.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/patchedast.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/rename.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/restructure.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/similarfinder.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/sourceutils.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/suites.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/topackage.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/usefunction.pyc
Binary file not shown.
Binary file modified Support/lib/rope/refactor/wildcards.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<string>D40BBBDD-2EDF-41A7-8B00-16E4442FCE4D</string>
<string>1D82239A-E8AE-48A8-9653-BC7F2AD6D8CC</string>
<string>21AFB944-D812-48D9-B3C2-23743840CA6F</string>
<string>60BA84AA-EDE8-41A5-9EB4-FB34B1E2A36C</string>
<string>DE9FF600-B7C9-4F80-AA5F-BC73A7BD07F4</string>
</array>
<key>uuid</key>
Expand Down

0 comments on commit 8ba07b3

Please sign in to comment.