Commits


reply-last-input: reply input requests on demand Telescope now remebers the last URL (per tab!) that replied with 1X (input request.) The new command reply-last-input allows to resend a query to that URL. It's particularly useful with capsules that make a heavy uses of 10 replies (search engines or similar, interactive pages, etc) because it both saves a network roundtrip and the user from looking for the "search" link all across the page ;-) idea from a conversation with thfr@, thanks!


move load_page_from_str to telescope.c I'd like to use parser{,_gophermap,_gemtext}.c in standalone testing programs, and this function is getting in the way since it depends on ui.c


parsers: add serialize function Add a parser_serialize function and an optional function `serialize' for parsers. The default implementation just prints the text line, which is suitable for parser_textplain and parser_textpatch; gemtext and gophermap uses their own specific unparse functions. This is intended for an incoming cache refactoring: we'll cache the page serialized in the correct format, not once it has been translated to gemtext. This will allow in the future to provide commands such as ``save page to disk'' or interface with an on-disk cache.


add fn pointer to the parser init function to struct parser will come in handy in the future cache refactoring.


save and restore scroll position Save the offset to the first and current line of the buffers and restore it when the page is loaded. This restores almost the exact viewport: we save the offset of the *real* line in the document, but they get wrapped before being displayed, so the actual restored position may be slightly above from the original one (think of a long paragraph that gets wrapped over multiple visual lines.) In practice, this isn't a drawback but only an improvement over the current behaviour. In the future we could save also the offset *inside* the line, to restore the exact position, but that felt unnecessary for now. Persisting the postion on the session file ensures that even when re-opening telescope the scroll position is correct. There are some very active pages, such as antenna or other aggregator, where this feature doesn't really work well if you re-open the page after a while, since new links are available, but otherwise is a god sent! See also github issue #1


move util.c declarations in utils.h it's not spelled `util.h' because otherwise it'd get included instead of /usr/include/util.h


de-duplicate hash_* function: collect them in util.c


provide a way to bypass the cache This changes the last argument of load_url to be a `mode' bitmap instead of a boolean ``nohist''. LU_MODE_NOHIST is the old 1, LU_MODE_NONE is provided just for readability and the new LU_MODE_NOCACHE allows to bypass the caching when loading a page. Telescope only uses the cache when: - re-opens a closed tab - navigates backward and forward in the history All other situations result in the usual network request.


add vi-like `~' fringes after the end of the buffers


kill old, unused forward prototype for non-existant struct page


plug history memory leak when freeing a tab we have to release also its history.


allow to re-open closed tabs Save closed tabs to a "killed tabs" queue, for up to a max of "max-killed-tabs", and allow to re-open them. Keep the tab history but not its content. This integrates nicely with the session file, just add the "killed" flag as alias for TAB_KILLED and put it in the ktabshead queue upon initalization. It's thus possible to re-open closed tabs even after telescope has been closed, and tabs keeps their history! Add a new cmd, cmd_tab_undo_close, to try to re-open the most recently closed tab and bind it to `u'. While here, add a TODO for the tab history memory leak.


move know_host parsing to the fs process and load the store via imsgs Like previously did with the session file, now the main process doesn't parse anything with the only exception being the configuration file. With this in, the only bit from fs.h still used in the main process is the path to the configuration file.


avoid zero-timer hack by triggering session initialization with IMSG_INIT


implement persistent tab history The session file is now overloaded with the history info, that means that upon startup telescope can repopulate each tab history! The price to pay is that one can't start an old telescope with a new session file, otherwise will get a lot of fancy '<' and '>' tabs...