mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Attempt again to fix UnicodeDecodeError (issue #658)
This commit is contained in:
parent
1dbff80691
commit
2f5016262a
1 changed files with 5 additions and 2 deletions
|
@ -163,10 +163,13 @@ def built_command(options, description):
|
||||||
sentences = [x for x in sentences if x.strip()]
|
sentences = [x for x in sentences if x.strip()]
|
||||||
if not sentences: sentences = ['']
|
if not sentences: sentences = ['']
|
||||||
|
|
||||||
truncated_description = sentences[0] + '.'
|
udot = lossy_unicode('.')
|
||||||
|
uspace = lossy_unicode(' ')
|
||||||
|
|
||||||
|
truncated_description = lossy_unicode(sentences[0]) + udot
|
||||||
for line in sentences[1:]:
|
for line in sentences[1:]:
|
||||||
if not line: continue
|
if not line: continue
|
||||||
proposed_description = truncated_description + ' ' + line + '.'
|
proposed_description = lossy_unicode(truncated_description) + uspace + lossy_unicode(line) + udot
|
||||||
if len(proposed_description) <= max_description_width:
|
if len(proposed_description) <= max_description_width:
|
||||||
# It fits
|
# It fits
|
||||||
truncated_description = proposed_description
|
truncated_description = proposed_description
|
||||||
|
|
Loading…
Reference in a new issue