diff options
author | Justin Dailey <dail8859@yahoo.com> | 2013-09-06 01:36:19 +0400 |
---|---|---|
committer | Justin Dailey <dail8859@yahoo.com> | 2013-09-06 01:36:19 +0400 |
commit | 89a02fc4ef775d7933032b2a00ed8ebcca0d8b6d (patch) | |
tree | b3eb9cdb2cbaf0eb248930eb82028b06445966f7 /source/blender/blenkernel/intern/text.c | |
parent | 3b72f1824cf06216c70101ee0d29004cc6dc632d (diff) |
fix [#36656] text editor undo error when undoing paste command
When tabs to spaces is enabled and a paste command is undone, the improper number of characters could get removed. Also fixed issue with shift + left/right only selecting a max of 1 character.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 750f328e7e7..be43aae1ed3 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1947,6 +1947,7 @@ static unsigned int txt_redo_read_unicode(const char *undo_buf, int *undo_pos, s void txt_do_undo(Text *text) { int op = text->undo_buf[text->undo_pos]; + int prev_flags; unsigned int linep, i; unsigned int uchar; unsigned int curln, selln; @@ -2070,8 +2071,14 @@ void txt_do_undo(Text *text) txt_move_to(text, selln, selc, 1); if ((curln == selln) && (curc == selc)) { + /* disable tabs to spaces since moving right may involve skipping multiple spaces */ + prev_flags = text->flags; + text->flags &= ~TXT_TABSTOSPACES; + for (i = 0; i < linep; i++) txt_move_right(text, 1); + + text->flags = prev_flags; } txt_delete_selected(text); |