More work on transfer kitten

This commit is contained in:
Kovid Goyal
2021-09-16 15:27:53 +05:30
parent 4b074d723e
commit d2809a0acb
2 changed files with 7 additions and 3 deletions

View File

@@ -405,7 +405,7 @@ class Send(Handler):
self.cmd.styled('Permission granted for this transfer', fg='green')
self.print()
self.send_file_metadata()
self.loop_tick()
self.asyncio_loop.call_soon(self.loop_tick)
def start_transfer(self) -> None:
if self.manager.active_file is None:

View File

@@ -23,12 +23,16 @@ def safe_divide(numerator: Union[int, float], denominator: Union[int, float], ze
def reduce_to_single_grapheme(text: str) -> str:
limit = len(text)
if limit < 2:
return text
x = 1
while True:
while x < limit:
pos = truncate_point_for_length(text, x)
if pos > 0:
return text[:pos]
pos += 1
x += 1
return text
def render_path_in_width(path: str, width: int) -> str: