Fixed wrong display for ambiguous maps.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 28 Sep 2013 15:33:41 +0000 (17:33 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 28 Sep 2013 15:33:41 +0000 (17:33 +0200)
If there exist maps for 'a', 'aa' and 'aaa' the 'aaa' was displayed to the
user after the first typed 'a'.

src/map.c

index ee13214..7f87b7b 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -238,7 +238,6 @@ MapState map_handle_keys(const char *keys, int keylen)
                 /* find ambiguous matches */
                 if (!timeout && m->inlen > map.qlen && !strncmp(m->in, map.queue, map.qlen)) {
                     ambiguous++;
-                    showcmd(map.queue, map.qlen);
                 }
                 /* complete match or better/longer match than previous found */
                 if (m->inlen <= map.qlen
@@ -247,6 +246,7 @@ MapState map_handle_keys(const char *keys, int keylen)
                 ) {
                     /* backup this found possible match */
                     match = m;
+                    showcmd(map.queue, map.qlen);
                 }
             }
         }