enventor - implementing indentation

This commit is contained in:
ChunEon Park 2013-08-19 23:51:01 +09:00
parent d7e522bdbf
commit 294473900f
5 changed files with 27 additions and 5 deletions

View File

@ -122,9 +122,9 @@ deleted_line_cnt(const char *str)
}
static void
indent_apply(Evas_Object *entry)
indent_apply(edit_data *ed)
{
// int space = indent_depth_get(syntax_indent_data_get(ed->sh));
}
static void
@ -139,7 +139,7 @@ edit_changed_cb(void *data, Evas_Object *obj, void *event_info)
if (!strcmp(info->change.insert.content, "<br/>"))
{
last_line_inc(ed);
indent_apply(obj);
indent_apply(ed);
}
}
else

View File

@ -21,7 +21,21 @@ indent_term(indent_data *id)
}
int
indent_next_line_step(indent_data *id)
indent_depth_get(indent_data *id, const char *src, int pos)
{
if (!src || (pos < 1)) return 0;
int depth = 0;
char *cur = (char *) src;
char *end = src + pos;
while (cur && (cur <= end))
{
break;
}
return depth;
}

View File

@ -295,7 +295,7 @@ color_apply(color_data *cd, const char *src, int length, Eina_Bool realtime)
inside_comment = EINA_FALSE;
}
if (!src || length < 1) return NULL;
if (!src || (length < 1)) return NULL;
Eina_Strbuf *strbuf = cd->strbuf;
eina_strbuf_reset(strbuf);

View File

@ -51,3 +51,9 @@ syntax_color_data_get(syntax_helper *sh)
{
return sh->cd;
}
indent_data *
syntax_indent_data_get(syntax_helper *sh)
{
return sh->id;
}

View File

@ -1,2 +1,4 @@
indent_data *indent_init(Eina_Strbuf *strbuf);
void indent_term(indent_data *id);
indent_data * syntax_indent_data_get(syntax_helper *sh);
int indent_depth_get(indent_data *id, const char *src, int pos);