diff options
author | Pixel <Pixel> | 2001-05-01 22:58:11 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-05-01 22:58:11 +0000 |
commit | 76238caf382ad2f12cf280fc8af87801a1f803c7 (patch) | |
tree | 93fe79f6f04cceaeef23980011a12f0fe716bb48 | |
parent | 591935b6c3e87cdb7eb75fc679e20ffc8366811b (diff) |
Encore l'interface
-rw-r--r-- | lib/interface.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/interface.c b/lib/interface.c index d0e2880..e42f6d9 100644 --- a/lib/interface.c +++ b/lib/interface.c @@ -37,11 +37,17 @@ void ifloop(void) { cread = fgetc(input); switch (cread) { case 49: /* Home */ + for (i = 0; i < position; i++) { + printf("\010"); + } + position = 0; break; case 50: /* Insert */ insert ^= 1; break; case 52: /* End */ + printf("%s", &(buffer[position])); + position = strlen(buffer); break; case 67: /* Droite */ if (buffer[position]) { @@ -75,10 +81,10 @@ void ifloop(void) { case 8: /* backspace */ if (position) { supprime(&(buffer[--position])); - } - printf("\010%s ", &(buffer[position])); - for (i = 0; i <= strlen(&(buffer[position])); i++) { - printf("\010"); + printf("\010%s ", &(buffer[position])); + for (i = 0; i <= strlen(&(buffer[position])); i++) { + printf("\010"); + } } break; case 10: /* Entrée */ |