Fixed text not refreshing when prompt closes.

This commit is contained in:
Mazar Farran 2015-08-21 17:41:19 -07:00
parent 44e09d1662
commit e7e5431c3b
3 changed files with 11 additions and 6 deletions

View File

@ -7,12 +7,16 @@ so I don't plan on working on it anymore.
Probably the most well-developed program I made this summer. Probably the most well-developed program I made this summer.
How to use: ##How to use:
F4 quits (no prompt) usage: text [file ]
F5 saves the current file as save.txt
Current issues: * F4 quits (no prompt)
* F5 saves the current file (untitled.txt is the default name)
* F6 saves the current file and allows you to specify the filename.
(WARNING: no confirmation screen or error checking yet).
##Current issues:
x-y coordinates in ncurses correspond to rows and columns in x-y coordinates in ncurses correspond to rows and columns in
the text document. This means tabs are an issue and text the text document. This means tabs are an issue and text
@ -21,4 +25,4 @@ from document logic.
Can only save files under the name save.txt. Solution: create Can only save files under the name save.txt. Solution: create
a prompt window (from scratch...) that retuns a string to the a prompt window (from scratch...) that retuns a string to the
caller. caller. (Done!)

View File

@ -6,7 +6,7 @@ OBJS=text.o page.o line.o prompt.o
LIBS=-lncurses LIBS=-lncurses
text: $(OBJS) text: $(OBJS)
$(CC) $(CFLAGS) -o text.exe $(OBJS) $(LIBS) $(CC) $(CFLAGS) -o text $(OBJS) $(LIBS)
text.o: text.c text.h page.h line.h prompt.h text.o: text.c text.h page.h line.h prompt.h
$(CC) $(CFLAGS) -c text.c $(CC) $(CFLAGS) -c text.c

1
text.c
View File

@ -74,6 +74,7 @@ int main(int argc, char *argv[])
prompt_string("Save As:", page.filename); prompt_string("Save As:", page.filename);
save_file(argc, argv, &page); save_file(argc, argv, &page);
sprintf(status, "Saved as \'%s\'", page.filename); sprintf(status, "Saved as \'%s\'", page.filename);
print_page(&page, beg, end);
update_status(status); update_status(status);
break; break;
case KEY_UP: case KEY_UP: