1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 17:23:15 +02:00

core: add theme name completion

Add two completion items hooked alongside "layouts_names":

- "theme_themes_all": all theme names (built-ins from the registry
  plus every *.theme file in <weechat_config_dir>/themes/, including
  backup-*.theme). Used by tab-complete on /theme apply and
  /theme info.
- "theme_themes_user": user theme files only (excludes built-ins
  and backup-*.theme). Used by tab-complete on /theme save and
  /theme del, so users cannot accidentally try to overwrite a
  built-in name or save a name colliding with the reserved backup
  prefix.

Both callbacks share a small dir_exec_on_files-based helper to filter
the themes directory. The /theme command's completion template in
core-command.c is updated to reference these new items.
This commit is contained in:
Sébastien Helleu
2026-07-04 17:15:13 +02:00
parent a09bd50b92
commit 9aef5f452e
16 changed files with 221 additions and 19 deletions
+4 -4
View File
@@ -10114,10 +10114,10 @@ command_init (void)
"state can be restored with: `/theme apply backup-<timestamp>`. "
"This is controlled by the option weechat.look.theme_backup.")),
"list -backups"
" || apply"
" || save -full"
" || del"
" || info",
" || apply %(theme_themes_all)"
" || save %(theme_themes_user) -full"
" || del %(theme_themes_user)"
" || info %(theme_themes_all)",
&command_theme, NULL, NULL);
hook_command (
NULL, "toggle",