From e8a6bf6fb9b3acd11e03d318247ce33e53a5b692 Mon Sep 17 00:00:00 2001 From: Stephen Swaney Date: Sun, 10 Apr 2005 14:01:41 +0000 Subject: Bugfix for disappearing hilight bug and code re-org for text editor from Ricki Myers (themyers). Comes with nice juicy commit msg, too! - source/blender/blenkernel/BKE_text.h - Removed indent_paste, uncommen, unindent_lines, comment_paste, uncomment_paste, uncomment, set_tabs. All these functions cut and re-added text (I felt this was unsafe). whicch is was caused the highlight loss. - Now the only functions are Indent, Unindent, comment, uncomment, setcurr_tab. All these functions only take one @parm (struct Text) -indent(struct Text *text) copy's the selected text in a MEM_mallocN line by line added a tab at the begginning - Unindent(struct Text *text) Tests if current line starts with a tab. if TAB remove it - comment(struct Text *text) copy's the selected text in a MEM_mallocN and adding a # at the begginning - Uncomment(struct Text *text) Tests if current line starts with a #. if # remove it - setcurr_tab (Text *text) Checks for Tabs pri. to any text if : is found and not in a comment then Tabs is increased by one if "return", "break", "pass" is found then Tabs is decreased - blender/source/blender/src/header_text.c Changed: txt_cut_sel(text); indent_paste(text); TO: txt_order_cursors(text); indent(text); * no more cutting of the text - source/blender/src/drawtext.c set_tabs(Text *text) just calls setcurr_tab(text); --- source/blender/blenkernel/BKE_text.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/blender/blenkernel/BKE_text.h') diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index 71b8f1a4cc3..c76d6c9231b 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -89,17 +89,11 @@ void run_python_script (struct SpaceText *st); int jumptoline_interactive (struct SpaceText *st); void txt_export_to_object (struct Text *text); void txt_export_to_objects(struct Text *text); -void indent_paste (struct Text *text); void unindent (struct Text *text); void comment (struct Text *text); -void uncommen (struct Text *text); -void indent (struct Text *text, char *in_buffer); -void unindent_lines (struct Text *text, char *in_buffer); -void comment_paste (struct Text *text, char *in_buffer); -void uncomment_paste (struct Text *text, char *in_buffer); -void uncomment (struct Text *text); - -void set_tabs (struct Text *text); +void indent (struct Text *text); +void uncomment (struct Text *text); +int setcurr_tab (struct Text *text); /* Undo opcodes */ -- cgit v1.2.3