Install plugins to /usr/share rather than /usr/lib since they're
arch-independent. Many precedents can be found for scripted plugins
in /usr/share and fewer for /usr/lib.
Look for plugins in all XDG data directories and repurpose
the "plugin_dir" setting to override this behaviour.
This adds some complexity to the bot but unifies the project.
It might make sense to remove the "plugin_dir" setting.
Ensure the error stack is cleared after errors are processed.
Also handle NULL returns safely.
Makes the debug mode spew more data, though almost none of
the contexts is in reaction to network peer data.
The worst offenders are actually OpenSSL and Lua, this is
mostly about a preventable surprise.
This is more correct because we mix escape sequences for
attributes with text, however in practice no one will use
shit-jizz with degesch.
It is also a clean-up: "struct line_char" has been almost
halved in size. We used to use it as a cache and now we
recompute the multibyte sequence.
Of course, it'd be best to get rid of the linked list but
it would take a very long time to rewrite the algorithm.
Plus, it's not certain that it could be improved by much.
The change in "struct line_char_attrs" is merely cosmetical.
I've had this happen to me on Russian channels and it's highly
annoying because you lose the entire message. On the contrary,
this at worst screws up the last few characters of it.
Closes#2
Colour sequence skipping is somewhat involved, we might want to
add a helper generator to the "degesch" Lua library, in the form of
{substring, is_formatting}.
formatter_parse_mirc() isn't useful, a pure Lua implementation
would be more appropriate (where do we put that?)
When a backlog helper was running and the prompt changed,
it failed to restore within input_rl_show().
Since before input_rl_show() is called the prompt is empty
and in input_rl__restore() it will be changed to the new
version, just skip invoking any Readline functions within
input_rl_set_prompt() when the prompt is hidden. Simple
and straight-forward.
This bug is what I hinted at in the previous commit.
Now that I've learnt what exactly these characters are and how they
ended up in attribute strings, we can just eliminate them and disable
`backlog_helper_strip_formatting`. Saner defaults, again.
I've also added skipping of terminfo delay sequences, so now it's less
of an issue to pipe raw attribute sequences into backlog helpers.
Upstreamed after who knows how long, in a slightly modified form.
The marker looks fairly ugly without this and defaults should be
desirable.
It's possible to get the previous behaviour by resetting the separator
character in the configuration to an empty string. It might be
a better idea in general to just disallow this value with a special
validation callback, so that there's only one way to do it.
However given that without fancy-prompt.lua, an optional plugin,
the long line stands out considerably, it might actually be a good
idea to keep the old behaviour as the default. I'm torn.
Right now we don't care about the situation where the string occupies
more than one terminal cell or is some Unicode BS. User's problem.