]> git.deb.at Git - pkg/abook.git/blobdiff - edit.c
multibyte update
[pkg/abook.git] / edit.c
diff --git a/edit.c b/edit.c
index 8d39660156e90ca5ce884e8ba7b1080019e9f6ce..7abbb09ac9a1150fb2ec1c983459dcd90cdc42d1 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -9,6 +9,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <assert.h>
 #include "abook_curses.h"
 #include "ui.h"
 #include "abook.h"
@@ -146,7 +147,8 @@ print_editor_header(int item)
        else
                snprintf(header, EDITW_COLS, "%s", database[item][NAME]);
 
-       mvwaddstr(editw, 0, (EDITW_COLS - strlen(header)) / 2,
+       fprintf(stderr, "%d\n", strwidth(header));
+       mvwaddstr(editw, 0, (EDITW_COLS - strwidth(header)) / 2,
                        header);
 
        free(header);
@@ -398,6 +400,7 @@ edit_loop(int item)
                case 'a': tab = TAB_ADDRESS; break;
                case 'p': tab = TAB_PHONE; break;
                case 'o': tab = TAB_OTHER; break;
+               case 'C': tab = TAB_CUSTOM; break;
                case 'h':
                case KEY_LEFT: tab = tab == 0 ? MAX_TAB : tab - 1;
                               break;