Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR supersedes PR #89. It fixes it in two points:
The main point in this pull request is to enable tab completion of items
in the list of favourites.
To do this, the first three commits make the existing code for handling the
history generic enough so it can be used for the favourites, too.
The next commit actually manages the favourites list in memory; this results in
a change in the favourite file's on-disk format. There was code for
heuristically deciding what's what, but see below.
Then (9def345), the in-memory favourites are used to complete URIs,
which really is what (amost) all this is about; the new behaviour is
then made configurable in the following commit via the new config option
complete_uri_anywhere defaulting to false (current xombrero behaviour).
If you set it to 1, URI expansion will happen based on matches anywhere
in the URIs.
The current history format uses ctime in serialisation, but strptime with
locale-dependent input field descriptors in deseerialisation, which made it
break in non-English locales. With this proposal, this breakage would
have extended to favourites, so I'm fixing it in the final commit.
Essentially, with it xombrero pagelists would then start with a magic
and have ISO-style dates. The loaders check for the magic and, in this
commit, fall back to the legacy parsers if they don't find it.
One drawback mentioned in #89 remains: As in current HEAD, there are
two sources of URL completion: The completion model from complete.h, and
the manual stuff in cmd_getlist. The fact that completion_add_uri
didn't have an effect on completing "open" was really confusing to me.
Alas, I've not found an API to get to harmless char* to memory held
within a GtkTreeView, and, though I've not really investigated that, I
believe they can't sling around pointers to memory owned by them as it
could be freed essentially at any time. So, we'd have to teach
cmd_getlist to (conditionally?) free its stuff. I'm not sure whether
that effort is worth it, and maybe it's even right to have two methods
because they're really doing different things (but then a comment in
completion.c would be of great public service).