File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -563,9 +563,15 @@ def normalize(obj):
563563 i = index
564564 break
565565
566- # center around diff
567- start = max (i - (config .truncate_len // 2 ), 0 )
568- end = min (start + config .truncate_len , len (s ))
566+ # If the diff is within the first config.truncate_len characters,
567+ # start from the beginning (no need for "..." at the start)
568+ if i < config .truncate_len :
569+ start = 0
570+ end = min (config .truncate_len , len (s ))
571+ else :
572+ # center around diff for differences further into the string
573+ start = max (i - (config .truncate_len // 2 ), 0 )
574+ end = min (start + config .truncate_len , len (s ))
569575
570576 snippet = s [start :end ]
571577
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Config:
1313 """
1414
1515 def __init__ (self ):
16- self .truncate_len = 10
16+ self .truncate_len = 30
1717 self .dynamic_truncate = True
1818
1919 # Create boolean validators for your variables here (if needed):
You can’t perform that action at this time.
0 commit comments