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:
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/space_text.c5
-rw-r--r--source/blender/editors/space_text/text_draw.c11
-rw-r--r--source/blender/editors/space_text/text_header.c6
-rw-r--r--source/blender/editors/space_text/text_ops.c14
4 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 7f3741e8e17..c8c19a0bc93 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -38,7 +38,6 @@
#include "BLI_math.h"
#include "BLI_rand.h"
-#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_screen.h"
@@ -274,6 +273,8 @@ static void text_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", DOWNARROWKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_LINE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", PAGEUPKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_PAGE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", PAGEDOWNKEY, KM_PRESS, 0, 0)->ptr, "type", NEXT_PAGE);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", HOMEKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", FILE_TOP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", ENDKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", FILE_BOTTOM);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", HOMEKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", LINE_BEGIN);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", LINE_END);
@@ -285,6 +286,8 @@ static void text_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_LINE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", PREV_PAGE);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", NEXT_PAGE);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", HOMEKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", FILE_TOP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move_select", ENDKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "type", FILE_BOTTOM);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_delete", DELKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_NEXT_CHAR);
RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_delete", DKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_NEXT_CHAR);
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index fba2fe89997..926ccc1914a 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -44,8 +44,6 @@
#include "DNA_userdef_types.h"
#include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
#include "BKE_suggestions.h"
#include "BKE_text.h"
#include "BKE_utildefines.h"
@@ -174,12 +172,13 @@ void flatten_string_free(FlattenString *fs)
static int find_builtinfunc(char *string)
{
int a, i;
- char builtinfuncs[][11] = {"and", "as", "assert", "break", "class", "continue", "def",
+ char builtinfuncs[][9] = {"and", "as", "assert", "break", "class", "continue", "def",
"del", "elif", "else", "except", "exec", "finally",
"for", "from", "global", "if", "import", "in",
"is", "lambda", "not", "or", "pass", "print",
- "raise", "return", "try", "while", "yield"};
- for(a=0; a<30; a++) {
+ "raise", "return", "try", "while", "yield", "with"};
+
+ for(a=0; a < sizeof(builtinfuncs)/sizeof(builtinfuncs[0]); a++) {
i = 0;
while(1) {
/* If we hit the end of a keyword... (eg. "def") */
@@ -1357,7 +1356,7 @@ void text_update_cursor_moved(bContext *C)
ARegion *ar;
int i, x, winx= 0;
- if(!st || !st->text || st->text->curl) return;
+ if(ELEM3(NULL, st, st->text, st->text->curl)) return;
text= st->text;
diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c
index 3b1c882ff2f..4b37994c39e 100644
--- a/source/blender/editors/space_text/text_header.c
+++ b/source/blender/editors/space_text/text_header.c
@@ -49,12 +49,6 @@
#include "BLI_blenlib.h"
#include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_main.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h"
-#include "BKE_text.h"
#include "ED_screen.h"
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 7a3f0ff80e5..0e0a9592104 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -34,19 +34,17 @@
#include "MEM_guardedalloc.h"
-#include "DNA_constraint_types.h"
#include "DNA_text_types.h"
+#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
#include "PIL_time.h"
#include "BKE_context.h"
-#include "BKE_depsgraph.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_report.h"
-#include "BKE_suggestions.h"
#include "BKE_text.h"
#include "WM_api.h"
@@ -583,14 +581,17 @@ void TEXT_OT_run_script(wmOperatorType *ot)
/* api callbacks */
ot->poll= run_script_poll;
ot->exec= run_script_exec;
-}
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
/******************* refresh pyconstraints operator *********************/
static int refresh_pyconstraints_exec(bContext *C, wmOperator *op)
{
#ifndef DISABLE_PYTHON
+#if 0
Text *text= CTX_data_edit_text(C);
Object *ob;
bConstraint *con;
@@ -625,6 +626,7 @@ static int refresh_pyconstraints_exec(bContext *C, wmOperator *op)
}
}
#endif
+#endif
return OPERATOR_FINISHED;
}
@@ -2363,6 +2365,7 @@ static int find_and_replace(bContext *C, wmOperator *op, short mode)
SpaceText *st= CTX_wm_space_text(C);
Text *start= NULL, *text= st->text;
int flags, first= 1;
+ int found = 0;
char *tmp;
if(!st->findstr[0] || (mode == TEXT_REPLACE && !st->replacestr[0]))
@@ -2428,9 +2431,10 @@ static int find_and_replace(bContext *C, wmOperator *op, short mode)
first= 1;
}
else {
- BKE_reportf(op->reports, RPT_ERROR, "Text not found: %s", st->findstr);
+ if(!found) BKE_reportf(op->reports, RPT_ERROR, "Text not found: %s", st->findstr);
break;
}
+ found = 1;
} while(mode==TEXT_MARK_ALL);
return OPERATOR_FINISHED;