Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2018-06-28 11:10:09 +02:00
commit de30c47513
1 changed files with 10 additions and 3 deletions

View File

@ -40,7 +40,10 @@
#include "WM_api.h"
#include "WM_types.h"
#include "ED_text.h"
#include "ED_undo.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "text_format.h"
@ -284,10 +287,11 @@ static int text_autocomplete_invoke(bContext *C, wmOperator *op, const wmEvent *
ED_area_tag_redraw(CTX_wm_area(C));
if (texttool_suggest_first() == texttool_suggest_last()) {
TextUndoBuf *utxt = NULL; // FIXME
TextUndoBuf *utxt = ED_text_undo_push_init(C);
confirm_suggestion(st->text, utxt);
text_update_line_edited(st->text->curl);
text_autocomplete_free(C, op);
ED_undo_push(C, op->type->name);
return OPERATOR_FINISHED;
}
else {
@ -315,8 +319,6 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
(void)text;
TextUndoBuf *utxt = NULL; // FIXME
if (st->doplugins && texttool_text_is_active(st->text)) {
if (texttool_suggest_first()) tools |= TOOL_SUGG_LIST;
if (texttool_docs_get()) tools |= TOOL_DOCUMENT;
@ -343,8 +345,10 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
case MIDDLEMOUSE:
if (event->val == KM_PRESS) {
if (text_do_suggest_select(st, ar)) {
TextUndoBuf *utxt = ED_text_undo_push_init(C);
confirm_suggestion(st->text, utxt);
text_update_line_edited(st->text->curl);
ED_undo_push(C, op->type->name);
swallow = 1;
}
else {
@ -378,8 +382,10 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
case PADENTER:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
TextUndoBuf *utxt = ED_text_undo_push_init(C);
confirm_suggestion(st->text, utxt);
text_update_line_edited(st->text->curl);
ED_undo_push(C, op->type->name);
swallow = 1;
draw = 1;
}
@ -591,5 +597,6 @@ void TEXT_OT_autocomplete(wmOperatorType *ot)
ot->poll = text_space_edit_poll;
/* flags */
/* Undo is handled conditionally by this operator. */
ot->flag = OPTYPE_BLOCKING;
}