forked from enlightenment/efl
elm_code: Fix bug when deleting slection beyond start of document.
@fix
This commit is contained in:
parent
8c93a207c1
commit
e44c33f233
|
@ -654,7 +654,7 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd,
|
||||||
Evas_Coord ox = 0, oy = 0, sx = 0, sy = 0, rowy = 0;
|
Evas_Coord ox = 0, oy = 0, sx = 0, sy = 0, rowy = 0;
|
||||||
Evas_Object *grid;
|
Evas_Object *grid;
|
||||||
int cw = 0, ch = 0, gutter, retcol;
|
int cw = 0, ch = 0, gutter, retcol;
|
||||||
unsigned int guess = 1, number;
|
unsigned int guess = 1, number = 1;
|
||||||
|
|
||||||
widget = (Elm_Code_Widget *)obj;
|
widget = (Elm_Code_Widget *)obj;
|
||||||
evas_object_geometry_get(widget, &ox, &oy, NULL, NULL);
|
evas_object_geometry_get(widget, &ox, &oy, NULL, NULL);
|
||||||
|
@ -667,11 +667,13 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd,
|
||||||
|
|
||||||
if (y >= 0 && ch > 0)
|
if (y >= 0 && ch > 0)
|
||||||
guess = ((double) y / ch) + 1;
|
guess = ((double) y / ch) + 1;
|
||||||
|
if (guess > 1)
|
||||||
|
{
|
||||||
number = guess;
|
number = guess;
|
||||||
|
|
||||||
// unfortunately EINA_LIST_REVERSE_FOREACH skips to the end of the list...
|
// unfortunately EINA_LIST_REVERSE_FOREACH skips to the end of the list...
|
||||||
for (item = eina_list_nth_list(pd->grids, guess - 1), grid = eina_list_data_get(item);
|
for (item = eina_list_nth_list(pd->grids, number), grid = eina_list_data_get(item);
|
||||||
item;
|
number > 1 && item;
|
||||||
item = eina_list_prev(item), grid = eina_list_data_get(item))
|
item = eina_list_prev(item), grid = eina_list_data_get(item))
|
||||||
{
|
{
|
||||||
evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL);
|
evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL);
|
||||||
|
@ -681,6 +683,7 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd,
|
||||||
|
|
||||||
number--;
|
number--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (col)
|
if (col)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue