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.
This commit is contained in:
Itamar 2022-10-06 15:24:41 +03:00 committed by Sam Atkins
commit 2046a670b3
Notes: sideshowbarker 2024-07-17 06:12:03 +09:00

View file

@ -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;