Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'blenderkit/search.py')
-rw-r--r--blenderkit/search.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/blenderkit/search.py b/blenderkit/search.py
index eb1d2888..569d6a76 100644
--- a/blenderkit/search.py
+++ b/blenderkit/search.py
@@ -308,11 +308,13 @@ def split_subs(text):
threshold = 40
text = text.rstrip()
lines = []
+
while len(text) > threshold:
i = text.rfind(' ', 0, threshold)
i1 = text.rfind(',', 0, threshold)
- i = max(i, i1)
- if i == -1:
+ i2 = text.rfind('.', 0, threshold)
+ i = max(i, i1, i2)
+ if i <= 0:
i = threshold
lines.append(text[:i])
text = text[i:]