@@ -37,6 +37,8 @@ void initialize_editor()
3737 init_pair (BOUNDARY_SCHEME , COLOR_BLACK , COLOR_CYAN ); //Initialize color pair of black text on a cyan background (for top and bottom boundaries)
3838 keypad (stdscr , true);
3939 cbreak ();
40+ //raw();
41+ //nonl();
4042 curs_set (1 );
4143}
4244
@@ -69,7 +71,7 @@ void content_line_print(int r, struct Window *w, struct Cursor *c)
6971 if (r == c -> y )
7072 j += (long ) c -> x - (c -> x %w -> width )- floor (c -> x /w -> width );
7173
72- for (i , j ; i < w -> width - 1 && j + i < get_end_of_line (j , w -> contents ); i ++ ) //Repeat the following code segment until the rest of the bar is full
74+ for (; i < w -> width - 1 && j + i < get_end_of_line (j , w -> contents ); i ++ ) //Repeat the following code segment until the rest of the bar is full
7375 {
7476 if (w -> contents [j + i ]!= '\t' )
7577 addch (w -> contents [j + i ]);
@@ -113,6 +115,7 @@ bool msg_box(struct Window *w, char *msg)
113115 return false;
114116 break ;
115117 }
118+ return NULL ;
116119}
117120
118121void dialog (struct Window * w , char * prompt , char * msg )
@@ -136,6 +139,7 @@ void run_mode(int m, struct Window *w, struct Cursor *c, struct File *f)
136139 *based upon the current given mode of operation
137140 */
138141{
142+ int rep ;
139143 switch (m )
140144 {
141145 case EDIT_MODE :
@@ -156,16 +160,17 @@ void run_mode(int m, struct Window *w, struct Cursor *c, struct File *f)
156160 dialog (w , "File path:" , "Open File" );
157161 if (!dialog_input (w ,f -> path ))
158162 {
159- open (w ,f );
163+ open_file (w ,f );
160164 m = EDIT_MODE ;
161165 }
162166 break ;
163167 case NEW_FILE :
164168 dialog (w , "File path:" , "New File" );
165169 if (!dialog_input (w ,f -> path ))
166170 {
167- new (w ,f ,c );
168- if (f -> fp = fopen (f -> path , "w" ))
171+ new (w ,c ,f );
172+ f -> fp = fopen (f -> path , "w" );
173+ if (f -> fp )
169174 {
170175 f -> ro = false;
171176 fclose (f -> fp );
0 commit comments