-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
[Suggestion] Save code editor bookmarks in cart as formfeed character #2272
Comments
I'd be against this approach as this as it sounds very much like a hack IMHO... if we really want to save bookmarks lets define a chunk type of the cartridge for doing so and then persist them properly. |
the only downside to storing bookmarks in a chunk type is that the bookmarks are separated from the source. That would complicate any external editor support, but that shouldn't really be the concern of tic80. Plus chunks do seem like the more "conical" way of saving any sort of cart data... Im convinced! A simple approach would be to simply store the line number of the bookmark, something like this
the example would result in bookmarks at lines |
Well tic80 already has code to persist binary chunks to TXT (that it uses for all the other areas of a cartridge inside a TXT file)... so any editor that really wanted to support bookmarks could just read and write that area of the TXT cartridge... I can't imagine it would be encoded all the difficult, perhaps just an array of words? |
Thumb up to this conversation ! 👍 Bookmark persistence may be one of the last big misses for me, subjectively. |
@joshgoebel I'm still try to wrap my head around chunks so forgive my ignorance 😄 By "just an array of words", do you mean a list of "binary words"? like |
Well that's a byte, 8 bits... I meant a word (2 bytes)... which lets you bookmark values between 1-65535... no need to get fancy. So for 20 bookmarks you'd need 20 words or a chunk of 40 bytes... |
As far as I can tell Bookmarks within the Code editor are not actually saved to the cart. That means they go away when you reload the cart or restart tic80 in any way.
My suggestion is to save these bookmarks in the source code using a Formfeed Character. I've been experimenting with this within emacs. Some observations/thoughts
Some more details on the formfeed character and "Pages" here --> https://www.gnu.org/software/emacs/manual/html_node/emacs/Pages.html
If this is agreeable to the people here, I'd be happy to try my hand at implementing this!
The text was updated successfully, but these errors were encountered: