commit - c3e1e821d1da78ba2bcf18d0ac2a674192a1a1f1
commit + f92b5d94f466c8d6958f15315b7f34555057dab1
blob - 16ab116b1c7318fec578459949184038656b20c8
blob + ed41387e11d9d343559131fc1fdf33f4bd71a6ea
--- fm.c
+++ fm.c
#define EDIT_DELETE(E) (E).right++
#define EDIT_CLEAR(E) do { (E).left = 0; (E).right = BUFLEN-1; } while(0)
-typedef enum EditStat { CONTINUE, CONFIRM, CANCEL } EditStat;
-typedef enum Color { DEFAULT, RED, GREEN, YELLOW, BLUE, CYAN, MAGENTA, WHITE, BLACK } Color;
+enum editstate { CONTINUE, CONFIRM, CANCEL };
+enum color { DEFAULT, RED, GREEN, YELLOW, BLUE, CYAN, MAGENTA, WHITE, BLACK };
+
typedef int (*PROCESS)(const char *path);
static void
/* Show a message on the status bar. */
static void
-message(Color color, char *fmt, ...)
+message(enum color c, char *fmt, ...)
{
int len, pos;
va_list args;
len = strlen(BUF1);
pos = (STATUSPOS - len) / 2;
attr_on(A_BOLD, NULL);
- color_set(color, NULL);
+ color_set(c, NULL);
mvaddstr(LINES - 1, pos, BUF1);
color_set(DEFAULT, NULL);
attr_off(A_BOLD, NULL);
}
/* Read input and change editing state accordingly. */
-static EditStat
+static enum editstate
get_line_edit()
{
wchar_t eraser, killer, wch;
/* Update line input on the screen. */
static void
-update_input(const char *prompt, Color color)
+update_input(const char *prompt, enum color c)
{
int plen, ilen, maxlen;
fm.edit_scroll = MAX(fm.edit.left - maxlen, 0);
color_set(RVC_PROMPT, NULL);
mvaddstr(LINES - 1, 0, prompt);
- color_set(color, NULL);
+ color_set(c, NULL);
mbstowcs(WBUF, INPUT, COLS);
mvaddnwstr(LINES - 1, plen, &WBUF[fm.edit_scroll], maxlen);
mvaddch(LINES - 1, plen + MIN(ilen - fm.edit_scroll, maxlen + 1),
const char *key;
const char *clip_path;
DIR *d;
- EditStat edit_stat;
+ enum editstate edit_stat;
FILE *save_cwd_file = NULL;
FILE *save_marks_file = NULL;
FILE *clip_file;
update_input(RVP_SEARCH, RED);
while ((edit_stat = get_line_edit()) == CONTINUE) {
int sel;
- Color color = RED;
+ enum color c = RED;
length = strlen(INPUT);
if (length) {
for (sel = 0; sel < fm.nfiles; sel++)
length))
break;
if (sel < fm.nfiles) {
- color = GREEN;
+ c = GREEN;
ESEL = sel;
if (fm.nfiles > HEIGHT) {
if (sel < 3)
SCROLL = oldscroll;
}
update_view();
- update_input(RVP_SEARCH, color);
+ update_input(RVP_SEARCH, c);
}
if (edit_stat == CANCEL) {
ESEL = oldsel;