@@ -29,6 +29,8 @@ const char *helpThemeIdKey = "helpThemeId";
2929// in BasicEditor.cxx
3030extern Fl_Text_Display::Style_Table_Entry styletable[];
3131
32+ static StyleField lastStyle = st_lineNumbers;
33+
3234//
3335// Profile constructor
3436//
@@ -74,6 +76,7 @@ void Profile::loadEditTheme(int themeId) {
7476 styletable[9 ].color = get_color (_theme._syntax_command ); // J - operators
7577 styletable[10 ].color = get_color (_theme._selection_background ); // K Selection Background
7678 styletable[11 ].color = get_color (_theme._background ); // L Background
79+ styletable[12 ].color = get_color (_theme._number_color ); // M Line numbers
7780}
7881
7982//
@@ -186,6 +189,7 @@ void Profile::updateTheme() {
186189 _theme._syntax_command = styletable[9 ].color >> 8 ;
187190 _theme._selection_background = styletable[10 ].color >> 8 ;
188191 _theme._background = styletable[11 ].color >> 8 ;
192+ _theme._number_color = styletable[12 ].color >> 8 ;
189193}
190194
191195//
@@ -236,20 +240,18 @@ void Profile::restoreStyles(Properties<String *> *profile) {
236240 _font = get_font (fontName->c_str ());
237241 }
238242
239- for (int i = 0 ; i <= st_background ; i++) {
243+ for (int i = 0 ; i <= lastStyle ; i++) {
240244 char buffer[4 ];
241245 sprintf (buffer, " %02d" , i);
242246 String *color = profile->get (buffer);
243247 if (color) {
244248 Fl_Color c = get_color (color->c_str (), NO_COLOR);
245249 if (c != (Fl_Color)NO_COLOR) {
246250 styletable[i].color = c;
247- if (i == st_background) {
248- _theme._background = c >> 8 ;
249- }
250251 }
251252 }
252253 }
254+ updateTheme ();
253255}
254256
255257//
@@ -347,7 +349,7 @@ void Profile::saveStyles(FILE *fp) {
347349 saveValue (fp, fontSizeKey, (int )styletable[0 ].size );
348350 saveValue (fp, fontNameKey, styletable[0 ].font );
349351
350- for (int i = 0 ; i <= st_background ; i++) {
352+ for (int i = 0 ; i <= lastStyle ; i++) {
351353 Fl::get_color (styletable[i].color , r, g, b);
352354 fprintf (fp, " %02d=#%02x%02x%02x\n " , i, r, g, b);
353355 }
0 commit comments