_append_line(code->file, "");
_append_line(code->file, "This is a demo of elm_code's capabilities.");
+ line = elm_code_file_line_get(code->file, 1);
+ elm_code_line_token_add(line, 17, 19, 1, ELM_CODE_TOKEN_TYPE_MATCH);
+ line = elm_code_file_line_get(code->file, 4);
+ elm_code_line_token_add(line, 18, 20, 1, ELM_CODE_TOKEN_TYPE_MATCH);
+
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(widget);
for (x = start; x <= end && x < count; x++)
{
- cells[x - 1].fg = type;
+ // TODO find a way to mark if a token is themes fg or bg
+ if (type == ELM_CODE_TOKEN_TYPE_MATCH)
+ cells[x - 1].bg = type;
+ else
+ cells[x - 1].fg = type;
}
}
grid = eina_list_nth(pd->grids, line->number - 1);
cells = evas_object_textgrid_cellrow_get(grid, 0);
- _elm_code_widget_fill_gutter(widget, cells, w, line->status, line->number);
- _elm_code_widget_fill_line_tokens(widget, cells, w, line);
-
length = elm_code_widget_line_text_column_width_get(widget, line);
chrpos = 0;
chr = (char *)elm_code_line_text_get(line, NULL);
cells[x].bg = _elm_code_widget_status_type_get(widget, line, x - gutter + 1);
}
+ _elm_code_widget_fill_gutter(widget, cells, w, line->status, line->number);
+ _elm_code_widget_fill_line_tokens(widget, cells, w, line);
+
_elm_code_widget_fill_selection(widget, line, cells, gutter, w);
_elm_code_widget_fill_cursor(widget, line->number, gutter, w);
if (line->number < elm_code_file_lines_get(line->file))
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_TOKEN_TYPE_CHANGED,
54, 54, 255, 255);
+ evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_TOKEN_TYPE_MATCH,
+ 187, 187, 51, 255);
+
// other styles that the widget uses
evas_object_textgrid_palette_set(o, EVAS_TEXTGRID_PALETTE_STANDARD, ELM_CODE_WIDGET_COLOR_SELECTION,
51, 153, 255, 255);