diff --git a/config.h b/config.h index 0c754c7..1743379 100644 --- a/config.h +++ b/config.h @@ -118,11 +118,11 @@ static const char size_unit[] = { 'B', 'K', 'M', 'G', 'T', 'P' }; /* this define static const char ui_btm_text_storage_left[] = "total free"; static const char ui_btm_current_dir_size[] = "sum of dir,"; -static const char ui_open_with_text_0[] = "open"; /*ui_open_with_text_0 \"selected_file\" ui_open_with_text_1*/ -static const char ui_open_with_text_1[] = "with:"; -static const char ui_rename_text_0[] = "rename"; /*ui_rename_text_0 \"selected_file\" ui_rename_text_1*/ -static const char ui_rename_text_1[] = "to:"; -static const char ui_delete_text[] = "delete:"; +static const char ui_open_with_text[] = "open "SETTINGS_COMMAND_REPLACE_STR" with:"; +static const char ui_rename_text[] = "rename "SETTINGS_COMMAND_REPLACE_STR" to:"; +static const char ui_mkdir_text[] = "mkdir:"; +static const char ui_touch_text[] = "touch:"; +static const char ui_delete_text[] = "delete: "SETTINGS_COMMAND_REPLACE_STR; /* {{{ */ static const unsigned long binding_count = sizeof(key_binding) / sizeof(binding); @@ -139,10 +139,10 @@ static const unsigned long mimetype_default_count; static const unsigned long file_extension_default_count; static const char size_unit[]; static const char size_unit_count; -static const char ui_open_with_text_0[]; -static const char ui_open_with_text_1[]; -static const char ui_rename_text_0[]; -static const char ui_rename_text_1[]; +static const char ui_open_with_text[]; +static const char ui_rename_text[]; +static const char ui_mkdir_text[]; +static const char ui_touch_text[]; static const char ui_delete_text[]; #endif /* }}} */ diff --git a/interactions.c b/interactions.c index 1044234..49d06e2 100644 --- a/interactions.c +++ b/interactions.c @@ -128,18 +128,18 @@ int read_string(WINDOW *win, int y, int x, char *str){ break; } else if (ch == '\t') { /* tab */ memcpy(str + pass, mid_dir.current_file->file_name, strlen(mid_dir.current_file->file_name)); - mvwaddstr(win, y, x +pass, mid_dir.current_file->file_name); + mvwaddstr(win, y, x + pass, mid_dir.current_file->file_name); pass += strlen(mid_dir.current_file->file_name); } else if (ch == 127) { /* backspace */ if (pass > 0) { pass--; - mvwdelch(win, y, pass); + mvwdelch(win, y, x + pass); } } else if (ch == 27) { /* esc key */ err = 1; break; } else { - mvwaddch(win, y, x +pass, ch); + mvwaddch(win, y, x + pass, ch); str[pass] = ch; pass++; } @@ -293,7 +293,8 @@ void makedir(){ wclear(win_b); file tmp; tmp.file_name = malloc(INPUT_BUFFER_SIZE); - if (read_string(win_b, 0, 0, tmp.file_name) == 0) { + mvwprintw(win_b, 0, 0, ui_mkdir_text); + if (read_string(win_b, 0, strlen(ui_mkdir_text)+1, tmp.file_name) == 0) { char *cmd = parse_cmd("mkdir ", &tmp); system(cmd); free(cmd); @@ -305,7 +306,8 @@ void makefile(){ wclear(win_b); file tmp; tmp.file_name = malloc(INPUT_BUFFER_SIZE); - if (read_string(win_b, 0, 0, tmp.file_name) == 0) { + mvwprintw(win_b, 0, 0, ui_touch_text); + if (read_string(win_b, 0, strlen(ui_touch_text)+1, tmp.file_name) == 0) { char *cmd = parse_cmd("touch ", &tmp); system(cmd); free(cmd);