mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Make Goto line a Popup and allow column input
This commit is contained in:
parent
e25776e95c
commit
f41cd8ad52
8 changed files with 110 additions and 53 deletions
|
@ -926,6 +926,9 @@ void ScriptTextEditor::_breakpoint_toggled(int p_row) {
|
|||
}
|
||||
|
||||
void ScriptTextEditor::_on_caret_moved() {
|
||||
if (code_editor->is_previewing_navigation_change()) {
|
||||
return;
|
||||
}
|
||||
int current_line = code_editor->get_text_editor()->get_caret_line();
|
||||
if (ABS(current_line - previous_line) >= 10) {
|
||||
Dictionary nav_state = get_navigation_state();
|
||||
|
@ -1518,7 +1521,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
|
|||
quick_open->set_title(TTR("Go to Function"));
|
||||
} break;
|
||||
case SEARCH_GOTO_LINE: {
|
||||
goto_line_dialog->popup_find_line(tx);
|
||||
goto_line_popup->popup_find_line(code_editor);
|
||||
} break;
|
||||
case BOOKMARK_TOGGLE: {
|
||||
code_editor->toggle_bookmark();
|
||||
|
@ -2272,8 +2275,8 @@ void ScriptTextEditor::_enable_code_editor() {
|
|||
quick_open->connect("goto_line", callable_mp(this, &ScriptTextEditor::_goto_line));
|
||||
add_child(quick_open);
|
||||
|
||||
goto_line_dialog = memnew(GotoLineDialog);
|
||||
add_child(goto_line_dialog);
|
||||
goto_line_popup = memnew(GotoLinePopup);
|
||||
add_child(goto_line_popup);
|
||||
|
||||
add_child(connection_info_dialog);
|
||||
|
||||
|
@ -2381,6 +2384,7 @@ ScriptTextEditor::ScriptTextEditor() {
|
|||
code_editor->get_text_editor()->set_draw_executing_lines_gutter(true);
|
||||
code_editor->get_text_editor()->connect("breakpoint_toggled", callable_mp(this, &ScriptTextEditor::_breakpoint_toggled));
|
||||
code_editor->get_text_editor()->connect("caret_changed", callable_mp(this, &ScriptTextEditor::_on_caret_moved));
|
||||
code_editor->connect("navigation_preview_ended", callable_mp(this, &ScriptTextEditor::_on_caret_moved));
|
||||
|
||||
connection_gutter = 1;
|
||||
code_editor->get_text_editor()->add_gutter(connection_gutter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue