From 43392c567e1fda3162eb76d7ebcdf17e9ee571e4 Mon Sep 17 00:00:00 2001 From: Itamar Date: Thu, 19 Aug 2021 16:56:55 +0300 Subject: [PATCH] HackStudio: Fix "navigate to include" This fixes an off-by-one error in the "navigate to include" feature of HackStudio. --- Userland/DevTools/HackStudio/Editor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index 632291387b..b8c37053d1 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -565,11 +565,9 @@ void Editor::flush_file_content_to_langauge_server() void Editor::on_navigatable_link_click(const GUI::TextDocumentSpan& span) { - auto adjusted_range = span.range; - adjusted_range.end().set_column(adjusted_range.end().column() + 1); - auto span_text = document().text_in_range(adjusted_range); + auto span_text = document().text_in_range(span.range); auto header_path = span_text.substring(1, span_text.length() - 2); - dbgln_if(EDITOR_DEBUG, "Ctrl+click: {} \"{}\"", adjusted_range, header_path); + dbgln_if(EDITOR_DEBUG, "Ctrl+click: {} \"{}\"", span.range, header_path); navigate_to_include_if_available(header_path); }