Jelajahi Sumber

HackStudio: Fix "navigate to include"

This fixes an off-by-one error in the "navigate to include" feature
of HackStudio.
Itamar 3 tahun lalu
induk
melakukan
43392c567e
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  1. 2 4
      Userland/DevTools/HackStudio/Editor.cpp

+ 2 - 4
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);
 }