Skip to content

Commit

Permalink
Don't change existing user's goto tag, move tab keybindings
Browse files Browse the repository at this point in the history
This provides a workaround so existing users who upgrade should now
be unaffected.

The default changed for these in commits
82769a0 and
9ae71ab, but this may be
confusing/annoying for existing users who have not edited any
keybindings.

Those commit messages were wrong about never affecting existing
users. Thanks to Lex for raising this.
  • Loading branch information
ntrel committed Mar 19, 2012
1 parent f4afe96 commit 99e8ed4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/keybindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,23 @@ static void load_kb(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer user_dat
static void load_user_kb(void)
{
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "keybindings.conf", NULL);
gchar *geanyconf = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
GKeyFile *config = g_key_file_new();

/* backwards compatibility with Geany 0.21 defaults */
if (!g_file_test(configfile, G_FILE_TEST_EXISTS) &&
g_file_test(geanyconf, G_FILE_TEST_EXISTS))
{
utils_write_file(configfile, "[Bindings]\n"
"popup_gototagdefinition=\n"
"edit_transposeline=<Control>t\n"
"edit_movelineup=\n"
"edit_movelinedown=\n"
"move_tableft=<Alt>Page_Up\n"
"move_tabright=<Alt>Page_Down\n");
}
g_free(geanyconf);

/* now load user defined keys */
if (g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL))
{
Expand Down

1 comment on commit 99e8ed4

@ntrel
Copy link
Member Author

@ntrel ntrel commented on 99e8ed4 Mar 19, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW the if test is incomplete, it doesn't identify a recent Geany. I'll fix this in the next few days.

Please sign in to comment.