def _get_smart_fold_pos(line, start, end):
linelen = end - start
ispace = line.rfind(' ', start, end)
# The space we waste for smart folding should be max. 1/3rd of the line
if ispace != -1 and ispace >= start + (2 * linelen) // 3:
return ispace
else:
return end
评论列表
文章目录