1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Prevent tooltip from showing when hovering past end of script line

This commit is contained in:
Lars Pettersson
2024-12-29 16:58:47 +01:00
parent 9630d4e2fc
commit ff39adddd1
6 changed files with 38 additions and 14 deletions

View File

@@ -421,7 +421,7 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
mpos.x = get_size().x - mpos.x;
}
Point2i pos = get_line_column_at_pos(mpos, false);
Point2i pos = get_line_column_at_pos(mpos, false, false);
int line = pos.y;
int col = pos.x;
@@ -443,18 +443,18 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
if (symbol_lookup_on_click_enabled) {
if (mm->is_command_or_control_pressed() && mm->get_button_mask().is_empty()) {
symbol_lookup_pos = get_line_column_at_pos(mpos);
symbol_lookup_pos = get_line_column_at_pos(mpos, false, false);
symbol_lookup_new_word = get_word_at_pos(mpos);
if (symbol_lookup_new_word != symbol_lookup_word) {
emit_signal(SNAME("symbol_validate"), symbol_lookup_new_word);
}
} else if (!mm->is_command_or_control_pressed() || (!mm->get_button_mask().is_empty() && symbol_lookup_pos != get_line_column_at_pos(mpos))) {
} else if (!mm->is_command_or_control_pressed() || (!mm->get_button_mask().is_empty() && symbol_lookup_pos != get_line_column_at_pos(mpos, false, false))) {
set_symbol_lookup_word_as_valid(false);
}
}
if (symbol_tooltip_on_hover_enabled) {
symbol_tooltip_pos = get_line_column_at_pos(mpos, false);
symbol_tooltip_pos = get_line_column_at_pos(mpos, false, false);
symbol_tooltip_word = get_word_at_pos(mpos);
symbol_tooltip_timer->start();
}
@@ -2388,7 +2388,7 @@ bool CodeEdit::is_symbol_lookup_on_click_enabled() const {
String CodeEdit::get_text_for_symbol_lookup() const {
Point2i mp = get_local_mouse_pos();
Point2i pos = get_line_column_at_pos(mp, false);
Point2i pos = get_line_column_at_pos(mp, false, false);
int line = pos.y;
int col = pos.x;