Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-08-29 08:52:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-29 08:53:12 +0400
commit1dddad93c45bb29e001afe21e24ae1f34aaa3e7f (patch)
tree23af524b88ee3efcf241ecddb1997ca780b0f986 /source/blender/blenkernel
parentf823ea1ac43f9e837b522aedb3e98cc52c3c38b7 (diff)
Fix Text editor home/end keys when theres a selection
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_text.h1
-rw-r--r--source/blender/blenkernel/intern/text.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index 4f77e4f5a23..1e79eaa8431 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -85,6 +85,7 @@ void txt_delete_char (struct Text *text);
void txt_delete_word (struct Text *text);
void txt_delete_selected (struct Text *text);
void txt_sel_all (struct Text *text);
+void txt_sel_clear (struct Text *text);
void txt_sel_line (struct Text *text);
char *txt_sel_to_buf (struct Text *text);
void txt_insert_buf (struct Text *text, const char *in_buffer);
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;