From 2046a670b3b12d77fcff35db372839b38debfb0e Mon Sep 17 00:00:00 2001 From: Itamar Date: Thu, 6 Oct 2022 15:24:41 +0300 Subject: [PATCH] HackStudio: Remove adjustment of text range for documentation tooltip We no longer need to adjust the hovered span's range to get the correct hovered text. This fixes the "documentation tooltip" feature. --- Userland/DevTools/HackStudio/Editor.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index 6f5a79fa63..b7e70041b9 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -263,11 +263,8 @@ void Editor::mousemove_event(GUI::MouseEvent& event) } if (span.range.contains(text_position)) { - auto adjusted_range = span.range; - auto end_line_length = document().line(span.range.end().line()).length(); - adjusted_range.end().set_column(min(end_line_length, adjusted_range.end().column() + 1)); - auto hovered_span_text = document().text_in_range(adjusted_range); - dbgln_if(EDITOR_DEBUG, "Hovering: {} \"{}\"", adjusted_range, hovered_span_text); + auto hovered_span_text = document().text_in_range(span.range); + dbgln_if(EDITOR_DEBUG, "Hovering: {} \"{}\"", span.range, hovered_span_text); if (is_clickable) { is_over_clickable = true;