diff options
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/CodeEditor.cxx | 7 | ||||
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index 38c23c3aa..af1e0c8ac 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -305,14 +305,17 @@ void CodeEditor::style_update(int pos, int nInserted, int nDeleted, end = editor->mBuffer->line_end(pos + nInserted); text = editor->mBuffer->text_range(start, end); style = editor->mStyleBuffer->text_range(start, end); - last = style[end - start - 1]; + if (start==end) + last = 0; + else + last = style[end - start - 1]; style_parse(text, style, end - start); editor->mStyleBuffer->replace(start, end, style); editor->redisplay_range(start, end); - if (last != style[end - start - 1]) { + if (start==end || last != style[end - start - 1]) { // The last character on the line changed styles, so reparse the // remainder of the buffer... free(text); diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index d5f3f0e36..3cd8e1a34 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1332,6 +1332,7 @@ void min_w_cb(Fl_Value_Input* i, void* v) { void min_h_cb(Fl_Value_Input* i, void* v) { if (v == LOAD) { + if (!current_widget->is_window()) return; i->value(((Fl_Window_Type*)current_widget)->sr_min_h); } else { int mod = 0; @@ -1348,6 +1349,7 @@ void min_h_cb(Fl_Value_Input* i, void* v) { void max_w_cb(Fl_Value_Input* i, void* v) { if (v == LOAD) { + if (!current_widget->is_window()) return; i->value(((Fl_Window_Type*)current_widget)->sr_max_w); } else { int mod = 0; @@ -1364,6 +1366,7 @@ void max_w_cb(Fl_Value_Input* i, void* v) { void max_h_cb(Fl_Value_Input* i, void* v) { if (v == LOAD) { + if (!current_widget->is_window()) return; i->value(((Fl_Window_Type*)current_widget)->sr_max_h); } else { int mod = 0; |
