diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-29 08:52:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-29 08:53:12 +0400 |
commit | 1dddad93c45bb29e001afe21e24ae1f34aaa3e7f (patch) | |
tree | 23af524b88ee3efcf241ecddb1997ca780b0f986 /source/blender/blenkernel/intern/text.c | |
parent | f823ea1ac43f9e837b522aedb3e98cc52c3c38b7 (diff) |
Fix Text editor home/end keys when theres a selection
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 47b615c2573..4cd85fb342e 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1286,6 +1286,19 @@ void txt_sel_all(Text *text) text->selc = text->sell->len; } +/** + * Reverse of #txt_pop_sel + * Clears the selection and ensures the cursor is located + * at the selection (where the cursor is visually while editing). + */ +void txt_sel_clear(Text *text) +{ + if (text->sell) { + text->curl = text->sell; + text->curc = text->selc; + } +} + void txt_sel_line(Text *text) { if (!text) return; |