Skip to content

Commit

Permalink
TreeBrowser: keybinding to track current file (#524)
Browse files Browse the repository at this point in the history
TreeBrowser has a "Follow current document" option, but I don't use it
because it causes the tree's root to change. Still, sometimes I have
a large tree and I want to quickly find the current document in it.
  • Loading branch information
vfaronov authored and frlan committed Feb 15, 2017
1 parent 0cc061b commit 4c6f860
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions treebrowser/src/treebrowser.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ enum
KB_CREATE_FILE,
KB_CREATE_DIR,
KB_REFRESH,
KB_TRACK_CURRENT,
KB_COUNT
};

Expand Down Expand Up @@ -2107,6 +2108,10 @@ static void kb_activate(guint key_id)
case KB_REFRESH:
on_menu_refresh(NULL, NULL);
break;

case KB_TRACK_CURRENT:
treebrowser_track_current();
break;
}
}

Expand Down Expand Up @@ -2139,6 +2144,8 @@ plugin_init(GeanyData *data)
0, 0, "create_dir", _("Create New Directory"), NULL);
keybindings_set_item(key_group, KB_REFRESH, kb_activate,
0, 0, "rename_refresh", _("Refresh"), NULL);
keybindings_set_item(key_group, KB_TRACK_CURRENT, kb_activate,
0, 0, "track_current", _("Track Current"), NULL);

plugin_signal_connect(geany_plugin, NULL, "document-activate", TRUE,
(GCallback)&treebrowser_track_current_cb, NULL);
Expand Down

0 comments on commit 4c6f860

Please sign in to comment.