Skip to content
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

[uberprompt.pl] themes reloaded on every /set and toggle (even unrelated) #670

Open
ailin-nemui opened this issue Sep 17, 2019 · 1 comment

Comments

@ailin-nemui
Copy link
Contributor

reported by pierrot

abstracts_register will reload the theme, so any /format changes are lost

@bw1
Copy link
Member

bw1 commented Sep 18, 2019

abstracts_register(abstracts)
	SV *abstracts
PREINIT:
	AV *av;
	char *key, *value;
	int i, len;
CODE:
        if (!SvROK(abstracts))
        	croak("abstracts is not a reference to list");
	av = (AV *) SvRV(abstracts);
	len = av_len(av)+1;
	if (len == 0 || (len & 1) != 0)
        	croak("abstracts list is invalid - not divisible by 2 (%d)", len);

        for (i = 0; i < len; i++) {
		key = SvPV_nolen(*av_fetch(av, i, 0)); i++;
		value = SvPV_nolen(*av_fetch(av, i, 0));

		theme_set_default_abstract(key, value);
	}
	themes_reload();
$ grep abstracts_register *.pl
uberprompt.pl:        Irssi::abstracts_register(['uberprompt', $prompt_format]);
uberprompt.pl:        Irssi::abstracts_register(['uberprompt_empty', $prompt_format_empty]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants