Ver código fonte

Functions for setting and clearing the prompt

master
lostd 10 anos atrás
pai
commit
5335be5832
1 arquivos alterados com 19 adições e 8 exclusões
  1. +19
    -8
      noice.c

+ 19
- 8
noice.c Ver arquivo

@@ -255,6 +255,21 @@ printerr(int ret, char *prefix)
exit(ret); exit(ret);
} }


/* Clear the last line */
void
clearprompt(void)
{
printmsg("");
}

/* Print prompt on the last line */
void
printprompt(char *str)
{
clearprompt();
printw(str);
}

/* /*
* Returns 0 normally * Returns 0 normally
* On movement it updates *cur * On movement it updates *cur
@@ -627,12 +642,10 @@ nochange:
goto nochange; goto nochange;
case SEL_FLTR: case SEL_FLTR:
/* Read filter */ /* Read filter */
printmsg(""); printprompt("filter: ");
move(LINES - 1, 0);
printw("filter: ");
tmp = readln(); tmp = readln();
if (tmp == NULL) { if (tmp == NULL) {
printmsg(""); clearprompt();
goto nochange; goto nochange;
} }
r = setfilter(&re, tmp); r = setfilter(&re, tmp);
@@ -653,12 +666,10 @@ nochange:
break; break;
case SEL_CD: case SEL_CD:
/* Read target dir */ /* Read target dir */
printmsg(""); printprompt("chdir: ");
move(LINES - 1, 0);
printw("chdir: ");
tmp = readln(); tmp = readln();
if (tmp == NULL) { if (tmp == NULL) {
printmsg(""); clearprompt();
goto nochange; goto nochange;
} }
if (testopendir(tmp) == 0) { if (testopendir(tmp) == 0) {


||||||
x
 
000:0
Carregando…
Cancelar
Salvar