summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/vector.h5
-rw-r--r--modules/gdscript/gd_compiler.cpp17
-rw-r--r--scene/gui/text_edit.cpp5
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--tools/editor/code_editor.cpp3
-rw-r--r--tools/editor/editor_settings.cpp1
-rw-r--r--tools/editor/plugins/script_editor_plugin.cpp1
7 files changed, 26 insertions, 7 deletions
diff --git a/core/vector.h b/core/vector.h
index 16a09c1ddd..87248ccf68 100644
--- a/core/vector.h
+++ b/core/vector.h
@@ -70,7 +70,8 @@ class Vector {
}
_FORCE_INLINE_ size_t _get_alloc_size(size_t p_elements) const {
- return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
+ //return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
+ return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
}
_FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const {
@@ -79,7 +80,7 @@ class Vector {
size_t p;
if (_mul_overflow(p_elements, sizeof(T), &o)) return false;
if (_add_overflow(o, sizeof(SafeRefCount)+sizeof(int), &p)) return false;
- *out = nearest_power_of_2_templated(p);
+ *out = nearest_power_of_2(p);
return true;
#else
// Speed is more important than correctness here, do the operations unchecked
diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp
index e8e8ce4e96..d38f5f3e35 100644
--- a/modules/gdscript/gd_compiler.cpp
+++ b/modules/gdscript/gd_compiler.cpp
@@ -1421,7 +1421,22 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars
if (path.is_rel_path()) {
- String base = p_script->get_path();
+ String base;
+
+ if (p_owner) {
+ GDScript *current_class = p_owner;
+ while (current_class != NULL) {
+ base=current_class->get_path();
+ if (base=="")
+ current_class = current_class->_owner;
+ else
+ break;
+ }
+ }
+ else {
+ base = p_script->get_path();
+ }
+
if (base=="" || base.is_rel_path()) {
_set_error("Could not resolve relative path for parent class: "+path,p_class);
return ERR_FILE_NOT_FOUND;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index a0887ffacd..f7461a736c 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -682,14 +682,12 @@ void TextEdit::_notification(int p_what) {
}
if (cache.line_number_w) {
- Color fcol = cache.font_color;
- fcol.a*=0.4;
String fc = String::num(line+1);
while (fc.length() < line_number_char_count) {
fc="0"+fc;
}
- cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT),ofs_y+cache.font->get_ascent()),fc,fcol);
+ cache.font->draw(ci,Point2(cache.style_normal->get_margin(MARGIN_LEFT),ofs_y+cache.font->get_ascent()),fc,cache.line_number_color);
}
const Map<int,Text::ColorRegionInfo>& cri_map=text.get_color_region_info(line);
@@ -3083,6 +3081,7 @@ void TextEdit::_update_caches() {
cache.style_focus=get_stylebox("focus");
cache.font=get_font("font");
cache.caret_color=get_color("caret_color");
+ cache.line_number_color=get_color("line_number_color");
cache.font_color=get_color("font_color");
cache.font_selected_color=get_color("font_selected_color");
cache.keyword_color=get_color("keyword_color");
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 899ce533c4..09c2a4d729 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -74,6 +74,7 @@ class TextEdit : public Control {
Ref<StyleBox> style_focus;
Ref<Font> font;
Color caret_color;
+ Color line_number_color;
Color font_color;
Color font_selected_color;
Color keyword_color;
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 968d02dfa5..cf8f40430b 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -148,6 +148,7 @@ void FindReplaceDialog::_replace_skip_callback() {
void FindReplaceDialog::_replace() {
+ text_edit->begin_complex_operation();
if (is_replace_all_mode()) {
//line as x so it gets priority in comparison, column as y
@@ -228,7 +229,7 @@ void FindReplaceDialog::_replace() {
_search();
}
-
+ text_edit->end_complex_operation();
}
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index 255ad40bce..31da68cb8c 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -393,6 +393,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("global/show_script_in_scene_tabs",false);
set("text_editor/background_color",Color::html("3b000000"));
set("text_editor/caret_color",Color::html("aaaaaa"));
+ set("text_editor/line_number_color",Color::html("66aaaaaa"));
set("text_editor/text_color",Color::html("aaaaaa"));
set("text_editor/text_selected_color",Color::html("000000"));
set("text_editor/keyword_color",Color::html("ffffb3"));
diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp
index 5f2efc8f03..6ed44901f1 100644
--- a/tools/editor/plugins/script_editor_plugin.cpp
+++ b/tools/editor/plugins/script_editor_plugin.cpp
@@ -288,6 +288,7 @@ void ScriptTextEditor::_load_theme_settings() {
get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
+ get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0)));
get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));