From 62713aaf65264950aecad9237d50e911d7dad893 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 1 Aug 2019 12:19:22 +0100 Subject: fix bug in undo list allocation --- TODO | 2 +- files.c | 8 ++++++-- gramscii.1 | 4 ++++ gramscii.h | 2 +- screen.c | 1 + 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index ad0cba0..a406bfa 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ + optimize redraws (redraw only the modified rectangle) - fix bug with 'g' commands in arrow mode +- fir bug in reading commands from files - add screen geometry option (-g 25x80?) - read file at point - read output of command (!) -- use [ENTER] to exit from text insert - maybe move "text" mode to "t" - implement ellipse - (?) filled box (B) diff --git a/files.c b/files.c index 245b29b..17743a5 100644 --- a/files.c +++ b/files.c @@ -50,8 +50,12 @@ void load_file(FILE *fc){ get_string(fc, "Load file: ", newfname, 255); if ((fin=fopen(newfname, "r")) != NULL){ i = 0; - while((fgets(screen.l[i].s, WIDTH+2, fin)) != NULL && i. You can use, copy, modify, and redistribute diff --git a/gramscii.h b/gramscii.h index 7c715a6..0792a38 100644 --- a/gramscii.h +++ b/gramscii.h @@ -82,7 +82,7 @@ typedef struct{ #define progr_x(d) ((d) == DIR_L ? -1 : (d) == DIR_R ? 1 : 0) #define progr_y(d) ((d) == DIR_U ? -1 : (d) == DIR_D ? 1 : 0) -/** #define DEBUG 1 **/ +#define DEBUG 1 /** global variables **/ diff --git a/screen.c b/screen.c index e347ea3..c27ab8b 100644 --- a/screen.c +++ b/screen.c @@ -409,6 +409,7 @@ void init_screen(){ cutbuf.l = NULL; cutbuf.num = 0; + undo = NULL; undo_sz = 0; undo_cur = -2; undo_lst = -2; -- cgit v1.2.3