28 lines
541 B
C
28 lines
541 B
C
#include <stdio.h>
|
|
#include "line-ed.h"
|
|
#include "prompt.h"
|
|
|
|
void show_prompt(struct line_ed *ed)
|
|
{
|
|
int type = PROMPT_MAIN;
|
|
if (ed->l_scope_type) {
|
|
type = PROMPT_CONT;
|
|
|
|
/* this is a temporary solution to show the current
|
|
* scope type, until prompts are implemented properly. */
|
|
fputs(ed->l_scope_type, stdout);
|
|
}
|
|
|
|
if (ed->l_continuations > 0) {
|
|
type = PROMPT_CONT;
|
|
}
|
|
|
|
fputs(ed->l_prompt[type], stdout);
|
|
fflush(stdout);
|
|
}
|
|
|
|
size_t prompt_length(struct line_ed *ed, int prompt_id)
|
|
{
|
|
return strlen(ed->l_prompt[prompt_id]);
|
|
}
|