summaryrefslogtreecommitdiff
path: root/src/core/wee-config.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-04-19 16:34:50 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-04-19 16:35:39 +0200
commit19baa79d64dac93c6d1160e44b8daa8dd9a2b2d7 (patch)
treea5bfd604571a834a1a56b80fee9542229e49e427 /src/core/wee-config.c
parent389e7193029eb57179db22fa80b2d794a9f537e4 (diff)
downloadweechat-19baa79d64dac93c6d1160e44b8daa8dd9a2b2d7.zip
core: convert deprecated commands bound to keys when upgrading weechat.conf to v2
Diffstat (limited to 'src/core/wee-config.c')
-rw-r--r--src/core/wee-config.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index fc512b520..87fdf749b 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -1524,8 +1524,27 @@ config_weechat_update_cb (const void *pointer, void *data,
struct t_hashtable *data_read)
{
const char *ptr_section, *ptr_option, *ptr_value;
+ char *new_commands[][2] = {
+ /* old command, new command */
+ { "/input jump_smart", "/buffer jump smart" },
+ { "/input jump_last_buffer", "/buffer +" },
+ { "/window ${_window_number};/input jump_last_buffer", "/window ${_window_number};/buffer +" },
+ { "/input jump_last_buffer_displayed", "/buffer jump last_displayed" },
+ { "/input jump_previously_visited_buffer", "/buffer jump prev_visited" },
+ { "/input jump_next_visited_buffer", "/buffer jump next_visited" },
+ { "/input hotlist_clear", "/hotlist clear" },
+ { "/input hotlist_remove_buffer", "/hotlist remove" },
+ { "/input hotlist_restore_buffer", "/hotlist restore" },
+ { "/input hotlist_restore_all", "/hotlist restore -all" },
+ { "/input set_unread_current_buffer", "/buffer set unread" },
+ { "/input set_unread", "/allbuf /buffer set unread" },
+ { "/input switch_active_buffer", "/buffer switch" },
+ { "/input switch_active_buffer_previous", "/buffer switch -previous" },
+ { "/input zoom_merged_buffer", "/buffer zoom" },
+ { NULL, NULL },
+ };
char *new_option;
- int changes;
+ int changes, i;
/* make C compiler happy */
(void) pointer;
@@ -1594,6 +1613,21 @@ config_weechat_update_cb (const void *pointer, void *data,
free (new_option);
}
}
+ for (i = 0; new_commands[i][0]; i++)
+ {
+ if (ptr_value && (strcmp (ptr_value, new_commands[i][0]) == 0))
+ {
+ gui_chat_printf (
+ NULL,
+ _("Command converted for key \"%s\": \"%s\" => \"%s\""),
+ hashtable_get (data_read, "option"),
+ new_commands[i][0],
+ new_commands[i][1]);
+ hashtable_set (data_read, "value", new_commands[i][1]);
+ changes++;
+ break;
+ }
+ }
}
}