JulianEberius / SublimeRope

ST2 only, use SublimePythonIDE with ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope library
GNU General Public License v2.0
250 stars 26 forks source link

Autoimport inserts at position 1 on failure, which could be in the middle of a module docstring #62

Closed jasonmyers closed 11 years ago

jasonmyers commented 11 years ago

For example:

"""
    This is a module
"""
foo = datetime.datetime.utcnow()

becomes

"""
import datetime
    This is a module
"""
foo = datetime.datetime.utcnow()

Changing it to 0 ensures it is put at the absolute top of the file

JulianEberius commented 11 years ago

Makes sense, thank you. This also seems like a patch that should be applied to Rope in general and not only to SublimeRope's fork, since it returns 0-based line numbers (https://bitbucket.org/agr/rope).

JulianEberius commented 11 years ago

In hindsight, I took this change back (as explained in pull request #61).