Anonymous avatar Anonymous committed d3cda29

Current line should be in error_limit, too

Comments (0)

Files changed (2)

 ===========
 
 
+- Specifying the number of fixes in code_assist : December 10, 2007
+
+
 - Deprecated `Pycore.create_(module|package)` : November 29, 2007
 
 

rope/contrib/codeassist.py

                                  self.resource, self.maxfixes)
         module_scope = pymodule.get_scope()
         code = pymodule.source_code
-        lines = code.split('\n')
+        lines = code.splitlines()
         result = {}
         start = _logical_start(lines, lineno)
         indents = _get_line_indents(lines[start - 1])
 def _get_pymodule(pycore, code, resource, maxfixes=1, error_limit=None):
     """Get a `PyModule`
 
-    Errors before `error_limit` offset arereported and are not never
+    Errors before `error_limit` offset are reported and are not never
     fixed.
 
     """
                     commenter = _Commenter(code.splitlines())
                 if error_limit is not None:
                     offset = 0
-                    for line in commenter.lines[:e.lineno]:
+                    for line in commenter.lines[:e.lineno - 1]:
                         offset += len(line) + 1
                     if offset <= error_limit:
                         raise
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.