summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/gui/tree.cpp28
-rw-r--r--scene/main/scene_tree.cpp5
3 files changed, 21 insertions, 16 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 6e7d1eb8a9..a5de50af99 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2115,14 +2115,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
//keep indentation
int space_count = 0;
for (int i = 0; i < text[cursor.line].length(); i++) {
- if (text[cursor.line][i] == '\t') {
+ if (text[cursor.line][i] == '\t' && cursor.column > 0) {
if (indent_using_spaces) {
ins += space_indent;
} else {
ins += "\t";
}
space_count = 0;
- } else if (text[cursor.line][i] == ' ') {
+ } else if (text[cursor.line][i] == ' ' && cursor.column > 0) {
space_count++;
if (space_count == indent_size) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f4e1bff9af..a40d1acb8f 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2473,22 +2473,24 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Point2 pos = b->get_position() - bg->get_offset();
cache.click_type = Cache::CLICK_NONE;
- if (show_column_titles && b->get_button_index() == BUTTON_LEFT) {
+ if (show_column_titles) {
pos.y -= _get_title_button_height();
if (pos.y < 0) {
- pos.x += cache.offset.x;
- int len = 0;
- for (int i = 0; i < columns.size(); i++) {
-
- len += get_column_width(i);
- if (pos.x < len) {
-
- cache.click_type = Cache::CLICK_TITLE;
- cache.click_index = i;
- //cache.click_id=;
- update();
- break;
+ if (b->get_button_index() == BUTTON_LEFT) {
+ pos.x += cache.offset.x;
+ int len = 0;
+ for (int i = 0; i < columns.size(); i++) {
+
+ len += get_column_width(i);
+ if (pos.x < len) {
+
+ cache.click_type = Cache::CLICK_TITLE;
+ cache.click_index = i;
+ //cache.click_id=;
+ update();
+ break;
+ }
}
}
break;
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 03a604734e..33331a465f 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -1401,8 +1401,11 @@ void SceneTree::_live_edit_create_node_func(const NodePath &p_parent, const Stri
Node *n2 = n->get_node(p_parent);
Node *no = Object::cast_to<Node>(ClassDB::instance(p_type));
- no->set_name(p_name);
+ if (!no) {
+ continue;
+ }
+ no->set_name(p_name);
n2->add_child(no);
}
}