diff options
-rw-r--r-- | doc/tools/makerst.py | 30 | ||||
-rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 5 |
3 files changed, 35 insertions, 8 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 492f3b6d54..9e767bf3d6 100644 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -155,8 +155,9 @@ def rstize_text(text, cclass): # Escape * character to avoid interpreting it as emphasis pos = 0 + next_brac_pos = text.find('['); while True: - pos = text.find('*', pos) + pos = text.find('*', pos, next_brac_pos) if pos == -1: break text = text[:pos] + "\*" + text[pos + 1:] @@ -165,7 +166,7 @@ def rstize_text(text, cclass): # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink pos = 0 while True: - pos = text.find('_', pos) + pos = text.find('_', pos, next_brac_pos) if pos == -1: break if not text[pos + 1].isalnum(): # don't escape within a snake_case word @@ -264,6 +265,27 @@ def rstize_text(text, cclass): if escape_post and post_text and post_text[0].isalnum(): # not punctuation, escape post_text = '\ ' + post_text + next_brac_pos = post_text.find('[',0) + iter_pos = 0 + while not inside_code: + iter_pos = post_text.find('*', iter_pos, next_brac_pos) + if iter_pos == -1: + break + post_text = post_text[:iter_pos] + "\*" + post_text[iter_pos + 1:] + iter_pos += 2 + + iter_pos = 0 + while not inside_code: + iter_pos = post_text.find('_', iter_pos, next_brac_pos) + if iter_pos == -1: + break + if not post_text[iter_pos + 1].isalnum(): # don't escape within a snake_case word + post_text = post_text[:iter_pos] + "\_" + post_text[iter_pos + 1:] + iter_pos += 2 + else: + iter_pos += 1 + + text = pre_text + tag_text + post_text pos = len(pre_text) + len(tag_text) @@ -500,7 +522,7 @@ def make_rst_class(node): enums.append(c) else: consts.append(c) - + if len(consts) > 0: f.write(make_heading('Numeric Constants', '-')) for c in list(consts): @@ -512,7 +534,7 @@ def make_rst_class(node): s += ' --- ' + rstize_text(c.text.strip(), name) f.write(s + '\n') f.write('\n') - + if len(enum_names) > 0: f.write(make_heading('Enums', '-')) for e in enum_names: diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 5197d3d888..47d730cdf1 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -470,10 +470,10 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from) { if (EditorSettings::get_singleton()->get("text_editor/theme/color_theme") == "Adaptive") { Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme(); - bg_color = tm->get_color("text_editor/theme/background_color", "Editor"); - keyword_color = tm->get_color("text_editor/theme/keyword_color", "Editor"); - text_color = tm->get_color("text_editor/theme/text_color", "Editor"); - symbol_color = tm->get_color("text_editor/theme/symbol_color", "Editor"); + bg_color = tm->get_color("text_editor/highlighting/background_color", "Editor"); + keyword_color = tm->get_color("text_editor/highlighting/keyword_color", "Editor"); + text_color = tm->get_color("text_editor/highlighting/text_color", "Editor"); + symbol_color = tm->get_color("text_editor/highlighting/symbol_color", "Editor"); } img->lock(); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index dd5127181d..2ff8536b4c 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -1023,6 +1023,9 @@ void AutotileEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { } } } else if (tools[SHAPE_NEW_POLYGON]->is_pressed()) { + if (!tools[TOOL_SELECT]->is_disabled()) + tools[TOOL_SELECT]->set_disabled(true); + if (mb.is_valid()) { if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { Vector2 pos = mb->get_position(); @@ -1089,6 +1092,8 @@ void AutotileEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { } else if (mb->is_pressed() && mb->get_button_index() == BUTTON_RIGHT && current_shape.size() > 2) { if (creating_shape) { close_shape(shape_anchor); + if (tools[TOOL_SELECT]->is_disabled()) + tools[TOOL_SELECT]->set_disabled(false); } } } else if (mm.is_valid()) { |