Use pending updates for unicode input kitten
Avoids all possibility of flicker
This commit is contained in:
parent
9cb5f6d9d7
commit
b1f4b2d8ed
@ -147,6 +147,16 @@ class Handler:
|
|||||||
def pending_update(self) -> ContextManager[None]:
|
def pending_update(self) -> ContextManager[None]:
|
||||||
return pending_update(self.write)
|
return pending_update(self.write)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def with_pending_update(cls, func: Callable) -> Callable:
|
||||||
|
from functools import wraps
|
||||||
|
|
||||||
|
@wraps(func)
|
||||||
|
def f(*a: Any, **kw: Any) -> Any:
|
||||||
|
with a[0].pending_update():
|
||||||
|
return func(*a, **kw)
|
||||||
|
return f
|
||||||
|
|
||||||
|
|
||||||
class HandleResult:
|
class HandleResult:
|
||||||
|
|
||||||
|
|||||||
@ -391,6 +391,7 @@ class UnicodeInput(Handler):
|
|||||||
text += ' ' * extra
|
text += ' ' * extra
|
||||||
self.print(styled(text, reverse=True))
|
self.print(styled(text, reverse=True))
|
||||||
|
|
||||||
|
@Handler.with_pending_update
|
||||||
def draw_screen(self) -> None:
|
def draw_screen(self) -> None:
|
||||||
self.write(clear_screen())
|
self.write(clear_screen())
|
||||||
self.draw_title_bar()
|
self.draw_title_bar()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user