forked from enlightenment/enventor
Redoundo: enable smart analyze for a pushed region text.
Manage text blocks, that used for autocomplete feature. This commit make possible to undo or redo whole block of text including user input. For example: user types "col" and choose "collections" from ctxpopup. In normal mode of undoredo module in case of undo action will be left "col" text. In smart mode whole block "collections" will be deleted.
This commit is contained in:
parent
5c95fa6e17
commit
6ab19b2b87
|
@ -62,9 +62,9 @@ smart_analyser(redoundo_data *rd, diff_data *diff)
|
|||
rd->smart.timer = NULL;
|
||||
}
|
||||
|
||||
if ((!diff) || (diff->length > 1)) return diff;
|
||||
if (!diff) return diff;
|
||||
|
||||
if (edit_auto_indent_get(rd->edit_data))
|
||||
if (diff->length == 1 && edit_auto_indent_get(rd->edit_data))
|
||||
{
|
||||
if (strstr(diff->text, "<br/>")) diff->relative = EINA_TRUE;
|
||||
else diff->relative = EINA_FALSE;
|
||||
|
@ -374,6 +374,9 @@ redoundo_text_push(redoundo_data *rd, const char *text, int pos, int length,
|
|||
diff->action = insert;
|
||||
diff->relative = EINA_FALSE;
|
||||
|
||||
diff = smart_analyser(rd, diff);
|
||||
rd->smart.continues_input = EINA_FALSE;
|
||||
|
||||
untracked_diff_free(rd);
|
||||
rd->queue = eina_list_append(rd->queue, diff);
|
||||
rd->last_diff = diff;
|
||||
|
|
Loading…
Reference in New Issue