Added cursor to default key bindings.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 21 Sep 2013 19:03:54 +0000 (21:03 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 21 Sep 2013 19:03:54 +0000 (21:03 +0200)
Removed those cursor keybindings that where introduced to fix an issue that
does not exist anymore.

src/default.h
src/main.c
src/map.c
src/map.h

index 26c70d2..c0c029d 100644 (file)
@@ -65,6 +65,8 @@ static char *default_config[] = {
     "set insecure-content-show=off",
     "set insecure-content-run=off",
 #endif
+    "cmap <Up> <C-P>",
+    "cmap <Down> <C-N>",
     NULL
 };
 
index a4f8609..4e3afd5 100644 (file)
@@ -731,7 +731,6 @@ static void init_core(void)
     mode_add('p', pass_enter, pass_leave, pass_keypress, NULL);
     mode_enter('n');
 
-    map_init();
     init_files();
     session_init();
     setting_init();
index c6a893f..938b545 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -49,16 +49,6 @@ static void showcmd(char *keys, int keylen, gboolean append);
 static void free_map(Map *map);
 
 
-void map_init(void)
-{
-    /* bind cursor keys to ^P and ^N but only in command mode else down would
-     * trigger the queue pop */
-    map_insert("<Up>", "\x10", 'c');
-    map_insert("<Down>", "\x0e", 'c');
-    map_insert("<Up>", "k", 'n');
-    map_insert("<Down>", "j", 'n');
-}
-
 void map_cleanup(void)
 {
     if (map.list) {
@@ -390,7 +380,8 @@ static char *map_convert_keys(char *in, int inlen, int *len)
                 }
             }
 
-            if (!raw) {
+            /* if we could not convert it jet - try to translate the label */
+            if (!rawlen) {
                 raw = map_convert_keylabel(p, symlen, &rawlen);
             }
         }
index 03b360d..26d66df 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -32,7 +32,6 @@ typedef enum {
     MAP_NOMATCH
 } MapState;
 
-void map_init(void);
 void map_cleanup(void);
 gboolean map_keypress(GtkWidget *widget, GdkEventKey* event, gpointer data);
 MapState map_handle_keys(const char *keys, int keylen);