diff options
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 6 |
3 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index fbca9bcc04f..1e710b88cad 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -462,10 +462,13 @@ static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { - if (drag->type == WM_DRAG_PATH) - if (ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_BLANK)) /* rule might not work? */ - return 1; - return 0; + if (drag->type == WM_DRAG_PATH) { + /* rule might not work? */ + if (ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_TEXT, ICON_FILE_BLANK)) { + return true; + } + } + return false; } static void text_drop_copy(wmDrag *drag, wmDropBox *drop) diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index c91c51ee5a9..480696760d4 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -397,7 +397,8 @@ static int text_draw_wrapped(SpaceText *st, const char *str, int x, int y, int w /* skip hidden part of line */ if (skip) { skip--; - fstart = fpos; mstart = mend; + fstart = fpos = end; + mstart = mend; mend = txt_utf8_forward_columns(str + mend, max, &padding) - str; end = (wrap += max - padding); continue; @@ -1459,7 +1460,7 @@ void text_scroll_to_cursor(SpaceText *st, ScrArea *sa) ARegion *ar = NULL; int i, x, winx = 0; - if (ELEM3(NULL, st, st->text, st->text->curl)) return; + if (ELEM(NULL, st, st->text, st->text->curl)) return; text = st->text; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index fcd6fb3c179..2e3d8d056e8 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1825,11 +1825,17 @@ static int text_move_cursor(bContext *C, int type, bool select) switch (type) { case LINE_BEGIN: + if (!select) { + txt_sel_clear(text); + } if (st && st->wordwrap && ar) txt_wrap_move_bol(st, ar, select); else txt_move_bol(text, select); break; case LINE_END: + if (!select) { + txt_sel_clear(text); + } if (st && st->wordwrap && ar) txt_wrap_move_eol(st, ar, select); else txt_move_eol(text, select); break; |