Closed autumn-birds closed 4 years ago
Took a quick first pass through the pull, it looks great. I would urge caution on the narrow/widen feature, though… autosave has saved my bacon more than once, when I shutdown the work computer or closed the terminal window before saving. I could see this happening to someone in narrow mode all too easily. Until we get the autosave working, could we wrap that code in an ifdef? Otherwise, we'll leave it on the dev branch and add all sorts of dire warnings.
Thanks for adding ALT support! I'm taking my first pokes at adding wide-char (UTF-8) support, and it sounds like you know more about how ncurses works than I do. I might lean on you for advice. :-)
Sure, an ifdef sounds reasonable. I'll try to do that (for some reason Github main page didn't notify me someone commented on my own pull request... I thought it would but I also haven't done this much before.)
The difficulty I had with autosave is that if the user adds nodes above or below the root node in narrow mode, calling the narrow command twice (my first thought) could make it look like part of the tree randomly disappeared. Thinking about it again, I bet it might be possible to write a specialized function to temporarily restore the whole tree for autosaves and the like; I may look into that a little.
About the ncurses thing, I just did some web searches and followed the examples I found, so I'm not exactly an expert. :)
I have some experimental code to try and fix up autosave in narrow mode now -- currently on a separate branch in my repository, I can merge it into my dev
branch later if desired (I'm out of time at the moment.)
The problem I did run into was that binary autosaves didn't want to load for me. I just got a single, empty root node and an error message (on the console after exiting) about some kind of header mismatch. Temporarily swapping the binary import/export for ascii (presumably that would work with any exportable format) was a very small change, and it seemed functional afterwards, from the very cursory testing I did. I also had this problem with v1.11.1
.
Is there a reason tines autosaves as binary and not hnb, for instance? Should I open an issue about this?
The binary autosave is a leftover from the hnb
days. I'm not sure why it's done that way. It should be an easy fix, and maybe I could patch in another compile-time option to get the old behavior.
This is mostly some things I wanted to make tines easier / more comfortable to use for my own purposes:
Alt
/Meta
keysThere's probably more that could be done on some of these things.
[This is all on the
dev
branch; I'm not sure whether you want that or you'd rather merge intomaster
.]