comparison finch/libgnt/gntfilesel.c @ 22289:0ba0f2804299

'\n' (ctrl-j) should behave similar to '\r' (ctrl-m). Fixes #4833.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 13 Feb 2008 05:57:54 +0000
parents 6de09629f091
children e2e57d3c0578
comparison
equal deleted inserted replaced
22288:f1fa491504eb 22289:0ba0f2804299
340 } 340 }
341 341
342 static gboolean 342 static gboolean
343 dir_key_pressed(GntTree *tree, const char *key, GntFileSel *sel) 343 dir_key_pressed(GntTree *tree, const char *key, GntFileSel *sel)
344 { 344 {
345 if (strcmp(key, "\r") == 0) { 345 if (strcmp(key, "\r") == 0 || strcmp(key, "\n") == 0) {
346 char *str = g_strdup(gnt_tree_get_selection_data(tree)); 346 char *str = g_strdup(gnt_tree_get_selection_data(tree));
347 char *path, *dir; 347 char *path, *dir;
348 348
349 if (!str) 349 if (!str)
350 return TRUE; 350 return TRUE;
374 int count; 374 int count;
375 glob_t gl; 375 glob_t gl;
376 struct stat st; 376 struct stat st;
377 int glob_ret; 377 int glob_ret;
378 #endif 378 #endif
379 if (strcmp(key, "\r")) 379 if (strcmp(key, "\r") && strcmp(key, "\n"))
380 return FALSE; 380 return FALSE;
381 381
382 str = (char*)gnt_entry_get_text(GNT_ENTRY(sel->location)); 382 str = (char*)gnt_entry_get_text(GNT_ENTRY(sel->location));
383 if (*str == G_DIR_SEPARATOR) 383 if (*str == G_DIR_SEPARATOR)
384 path = g_strdup(str); 384 path = g_strdup(str);