-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
GhostText protocol wishlist #255
Comments
My suggestion? Implement diff mode. First connectionBrowser sends editor the metadata (title, url, etc.) and the full text Rest of the lifetimeEvery time text changes in either browser or editor, it sends out a message that contains the line numbers from which the change starts, and the line number at which the change stops, and the whole text between those line numbers. e.g.
This way, GhostText can work on big files without needing to consume a ton of CPU. |
heh I was thinking about that earlier, but that complicates things a lot, because suddenly every message has to be delivered. The other complication is that a diff algorithm, especially with multiple cursors, still doesn't come free (CPU), and has to be implemented by each editor plugin in different languages. One editor gets this wrong and people lose data and open issues here. The only way I could do this would be with a standard, simple diffing algorithm available in multiple languages. This would avoid implementation errors and waste of dev time. I'd probably not implement this myself in any case due to the complexity, compared to just dynamic throttling (see the "updates" section in #256)
Totally agree, the current setup is awkward. PR welcome for that (including protocol.md). I suppose it would need to be sent via URL parameter though, which means it's limited in length (32k) and therefore it would need to be skipped when too long. I'm happy to make changes that are backwards compatible, I already made a couple of improvements this week: https://github.com/fregante/GhostText/commits/main/PROTOCOL.md |
Current
Future
EventSource
and HTTP/2 instead of WebSocketlabel
,[title]
,[aria-label]
, etc) to be used as tab titleThe text was updated successfully, but these errors were encountered: