summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-13 22:44:10 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-13 22:44:31 +0000
commit433c7ef8fe1c8d5a910e40a7af95574bff6d1d84 (patch)
treeddee6e64e0e261a5facb0a6899e16ac63cf4d74a
parent51599fe86c19da5024cdecd0e47debfd60522517 (diff)
elm_code: Fix tooltip crash
-rw-r--r--src/lib/elementary/elm_code_widget.c13
-rw-r--r--src/lib/elementary/elm_code_widget_private.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 592b8aa4a2..fd9e781984 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -431,7 +431,6 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Line *line)
431 if (line->number < elm_code_file_lines_get(line->file)) 431 if (line->number < elm_code_file_lines_get(line->file))
432 _elm_code_widget_fill_whitespace(widget, '\n', &cells[length + gutter]); 432 _elm_code_widget_fill_whitespace(widget, '\n', &cells[length + gutter]);
433 433
434 elm_object_tooltip_text_set(grid, line->status_text);
435 evas_object_textgrid_update_add(grid, 0, 0, w, 1); 434 evas_object_textgrid_update_add(grid, 0, 0, w, 1);
436} 435}
437 436
@@ -1098,7 +1097,17 @@ _elm_code_widget_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj
1098 _elm_code_widget_position_at_coordinates_get(widget, pd, event->cur.canvas.x, event->cur.canvas.y, &row, &col); 1097 _elm_code_widget_position_at_coordinates_get(widget, pd, event->cur.canvas.x, event->cur.canvas.y, &row, &col);
1099 1098
1100 if (!pd->editable || !event->buttons) 1099 if (!pd->editable || !event->buttons)
1101 return; 1100 {
1101 Elm_Code_Line *line;
1102
1103 line = elm_code_file_line_get(elm_code_widget_code_get(widget)->file, row);
1104 if (line)
1105 elm_object_tooltip_text_set(widget, line->status_text);
1106 else
1107 elm_object_tooltip_text_set(widget, NULL);
1108
1109 return;
1110 }
1102 1111
1103 if (!pd->selection) 1112 if (!pd->selection)
1104 if (col > 0 && row <= elm_code_file_lines_get(pd->code->file)) 1113 if (col > 0 && row <= elm_code_file_lines_get(pd->code->file))
diff --git a/src/lib/elementary/elm_code_widget_private.h b/src/lib/elementary/elm_code_widget_private.h
index 8ff71becbf..17b3810cdf 100644
--- a/src/lib/elementary/elm_code_widget_private.h
+++ b/src/lib/elementary/elm_code_widget_private.h
@@ -60,8 +60,6 @@ void _elm_code_widget_backspace(Elm_Code_Widget *widget);
60 60
61void _elm_code_widget_delete(Elm_Code_Widget *widget); 61void _elm_code_widget_delete(Elm_Code_Widget *widget);
62 62
63void _elm_code_widget_tooltip_text_set(Evas_Object *widget, const char *text);
64
65EAPI Elm_Code_Widget_Selection_Data *elm_code_widget_selection_normalized_get(Evas_Object *widget); 63EAPI Elm_Code_Widget_Selection_Data *elm_code_widget_selection_normalized_get(Evas_Object *widget);
66 64
67void _elm_code_widget_selection_delete_no_undo(Elm_Code_Widget *widget); 65void _elm_code_widget_selection_delete_no_undo(Elm_Code_Widget *widget);