Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it async #79

Open
glyph opened this issue Jul 7, 2020 · 4 comments
Open

make it async #79

glyph opened this issue Jul 7, 2020 · 4 comments

Comments

@glyph
Copy link

glyph commented Jul 7, 2020

The ability to asynchronously populate the contents of a buffer from a subprocess, and to update things without blocking, is a key feature of an extensible editor with a good user experience. Otherwise, extensions have a tendency to block the user interface and generally bog down as you add more of them.

Please consider adding support for this. Thanks!

(I dream of one day replacing my reams and reams of emacs lisp with Python, and Babi seems like a promising contender for that ;-))

@asottile
Copy link
Owner

asottile commented Jul 7, 2020

makes sense! I think I was getting pretty close to hitting this (adding some support for linters / plugins is pretty high on the list for "next things")

I might have to investigate writing some sort of async-friendly wrapper around curses since I'm not aware of anything that exists in that space 🤔

@glyph
Copy link
Author

glyph commented Jul 7, 2020

twisted.conch.insults provides an async terminal windowing library, which would also let you SSH into the editor to use it from multiple sessions at once 😎 .

I don't know if I'd seriously recommend it though unless you wanted to help maintain such a thing; it's unfortunately bereft of maintainers and somewhat thinly documented.

More practical is probably just sticking the curses file descriptor into an asyncio event loop, and using nodelay: https://docs.python.org/3/howto/curses.html#user-input

@asottile
Copy link
Owner

asottile commented Jul 7, 2020

yeah that makes sense, there's already some use of nodelay in babi for reading some specialized key sequences and it would probably be ~reasonably easy to adapt the central loop for that

I also want (at some point) to move the first-time syntax highlighting procedure to a background-ish task which would fix the current (major) lag (open large file, jump to end)

@graingert
Copy link

urwid is pretty nice and supports trio, asyncio and twisted etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants