forked from enlightenment/edi
Display the text position rather than the visual column in info
This fixes a bug where compile warnings for lines with tabs do not match.
This commit is contained in:
parent
6277dbe47a
commit
36bc269047
|
@ -84,7 +84,7 @@ edi_content_image_add(Evas_Object *parent, Edi_Mainview_Item *item)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
edi_content_statusbar_position_set(Evas_Object *position, unsigned int line, unsigned int col)
|
edi_content_statusbar_position_set(Evas_Object *position, unsigned int line, unsigned int pos)
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
char text[128];
|
char text[128];
|
||||||
|
@ -92,9 +92,9 @@ edi_content_statusbar_position_set(Evas_Object *position, unsigned int line, uns
|
||||||
|
|
||||||
if (!position) return;
|
if (!position) return;
|
||||||
|
|
||||||
if (line && col)
|
if (line && pos)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), _("Line: %d, Column: %d"), line, col);
|
snprintf(buf, sizeof(buf), _("Line: %d, Position: %d"), line, pos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1260,23 +1260,29 @@ static void
|
||||||
_edit_cursor_moved(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
_edit_cursor_moved(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Edi_Mainview_Item *item;
|
Edi_Mainview_Item *item;
|
||||||
|
Elm_Code *code;
|
||||||
|
Elm_Code_Line *line;
|
||||||
Elm_Code_Widget *widget;
|
Elm_Code_Widget *widget;
|
||||||
unsigned int line;
|
unsigned int row, col, pos;
|
||||||
unsigned int col;
|
|
||||||
|
|
||||||
widget = (Elm_Code_Widget *)obj;
|
widget = (Elm_Code_Widget *)obj;
|
||||||
if (widget)
|
if (widget)
|
||||||
{
|
{
|
||||||
elm_code_widget_cursor_position_get(widget, &line, &col);
|
elm_code_widget_cursor_position_get(widget, &row, &col);
|
||||||
|
|
||||||
|
code = elm_code_widget_code_get(widget);
|
||||||
|
line = elm_code_file_line_get(code->file, row);
|
||||||
|
|
||||||
|
pos = elm_code_widget_line_text_position_for_column_get(widget, line, col) + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line = 0; col = 0;
|
row = 0; pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
item = data;
|
item = data;
|
||||||
|
|
||||||
edi_content_statusbar_position_set(item->pos, line, col);
|
edi_content_statusbar_position_set(item->pos, row, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue