From 2b41489bd65fbab3c487cdff5caf0ffa2c01f2a1 Mon Sep 17 00:00:00 2001 From: "Dusty.P" Date: Tue, 5 Jun 2018 00:36:23 -0800 Subject: [PATCH] Error if keep intact has more lines than max_lines --- exts/imports/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exts/imports/utils.py b/exts/imports/utils.py index 6675ad1..1855972 100644 --- a/exts/imports/utils.py +++ b/exts/imports/utils.py @@ -201,7 +201,7 @@ class Paginator: self._parts.insert(i, part) if to_beginning else self._parts.append(part) i += 1 elif keep_intact and not item == self._page_break: - if len(item) >= self._max_chars: + if len(item) >= self._max_chars or item.count('\n') > self._max_lines: raise RuntimeError('{item} is too long to keep on a single page and is marked to keep intact.') if to_beginning: self._parts.insert(0, item)