summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 16:19:45 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2015-02-05 16:19:45 -0500
commitaf16532a904f773454dfd4e98b0c3aa8263d63b8 (patch)
tree4a52916cf24516fc255bf4ed1322a26936ebdf6a
parent2f8bb98c08a8158f9157e4c22d8a8dcd0037793c (diff)
downloadisort-af16532a904f773454dfd4e98b0c3aa8263d63b8.tar.gz
Honor wrap_length setting
-rw-r--r--isort/isort.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/isort/isort.py b/isort/isort.py
index 114daf07..8b6ae933 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -274,7 +274,7 @@ class SortImports(object):
if splitter in line and not line.strip().startswith(splitter):
line_parts = line.split(splitter)
next_line = []
- while (len(line) + 2) > self.config['line_length'] and line_parts:
+ while (len(line) + 2) > (self.config['wrap_length'] or self.config['line_length']) and line_parts:
next_line.append(line_parts.pop())
line = splitter.join(line_parts)
if not line:
@@ -373,7 +373,7 @@ class SortImports(object):
formatter = getattr(self, "_output_" + output_mode, self._output_grid)
dynamic_indent = " " * (len(import_start) + 1)
indent = self.config['indent']
- line_length = self.config['line_length']
+ line_length = self.config['wrap_length'] or self.config['line_length']
import_statement = formatter(import_start, copy.copy(from_imports),
dynamic_indent, indent, line_length, comments)
if self.config['balanced_wrapping']: