make the quick_url behavior the only option

This commit is contained in:
Daniel Micay 2013-02-20 03:39:13 -05:00
parent c0af43dd53
commit 6fb386b544
3 changed files with 5 additions and 9 deletions

View File

@ -129,5 +129,5 @@ and copied to the PRIMARY clipboard buffer.
With the text input widget focused, up/down (or tab/shift-tab) cycle through With the text input widget focused, up/down (or tab/shift-tab) cycle through
completions, escape closes the widget and enter accepts the input. completions, escape closes the widget and enter accepts the input.
After hints mode is activated, as single number or a comma separated list of In hints mode, the input will be accepted as soon as termite considers it a
hint numbers can be entered, which will be opened in the browser. unique match.

3
config
View File

@ -32,9 +32,6 @@ cursor_shape = block
# (default if unset: all graphic non-punctuation/space characters) # (default if unset: all graphic non-punctuation/space characters)
#word_chars = -A-Za-z0-9,./?%&#:_=+@~ #word_chars = -A-Za-z0-9,./?%&#:_=+@~
# if true, follow hints as soon as the typed text uniquely identifies it
quick_url = false
[colors] [colors]
foreground = #dcdccc foreground = #dcdccc
foreground_bold = #ffffff foreground_bold = #ffffff

View File

@ -69,7 +69,7 @@ struct hint_info {
struct config_info { struct config_info {
hint_info hints; hint_info hints;
char *browser; char *browser;
gboolean dynamic_title, urgent_on_bell, clickable_url, quick_url; gboolean dynamic_title, urgent_on_bell, clickable_url;
int tag; int tag;
char *config_file; char *config_file;
}; };
@ -748,7 +748,7 @@ gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *i
case GDK_KEY_7: case GDK_KEY_7:
case GDK_KEY_8: case GDK_KEY_8:
case GDK_KEY_9: case GDK_KEY_9:
if (info->panel.mode == overlay_mode::urlselect && info->config.quick_url) { if (info->panel.mode == overlay_mode::urlselect) {
const char *const text = gtk_entry_get_text(entry); const char *const text = gtk_entry_get_text(entry);
char *fulltext = g_strndup(text, strlen(text) + 1); char *fulltext = g_strndup(text, strlen(text) + 1);
fulltext[strlen(text)] = (char)event->keyval; fulltext[strlen(text)] = (char)event->keyval;
@ -1103,7 +1103,6 @@ static void set_config(GtkWindow *window, VteTerminal *vte, config_info *info,
info->dynamic_title = cfg_bool("dynamic_title", TRUE); info->dynamic_title = cfg_bool("dynamic_title", TRUE);
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE); info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
info->clickable_url = cfg_bool("clickable_url", TRUE); info->clickable_url = cfg_bool("clickable_url", TRUE);
info->quick_url = cfg_bool("quick_url", FALSE);
if (info->clickable_url) { if (info->clickable_url) {
info->tag = info->tag =
@ -1284,7 +1283,7 @@ int main(int argc, char **argv) {
std::vector<url_data>()}, std::vector<url_data>()},
{vi_mode::insert, 0, 0, 0, 0}, {vi_mode::insert, 0, 0, 0, 0},
{{nullptr, nullptr, nullptr, nullptr, 0, 0, 0}, {{nullptr, nullptr, nullptr, nullptr, 0, 0, 0},
nullptr, FALSE, FALSE, FALSE, FALSE, -1, config_file} nullptr, FALSE, FALSE, FALSE, -1, config_file}
}; };
load_config(GTK_WINDOW(window), vte, &info.config, &geometry); load_config(GTK_WINDOW(window), vte, &info.config, &geometry);