1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +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 delete, 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-05-26 19:01:11 +02:00
parent 4751a51b5a
commit 6f596e2504
2 changed files with 122 additions and 4 deletions
+4 -4
View File
@@ -10112,10 +10112,10 @@ command_init (void)
"backup-<timestamp>. This is controlled by the option "
"weechat.look.theme_backup.")),
"list -backups"
" || apply"
" || save -full"
" || delete"
" || info",
" || apply %(theme_themes_all)"
" || save %(theme_themes_user) -full"
" || delete %(theme_themes_user)"
" || info %(theme_themes_all)",
&command_theme, NULL, NULL);
hook_command (
NULL, "toggle",