فهرست منبع

HackStudio: Set_cursor even if the file is already open

Upon opening already opened file, the cursor was previously not
set to the correct line and column. With this patch, it should
be correctly set.

Fixes a bug where ctrl+clicking a function declaration would not
jump to the line if the file containing the function is already
open.
iyush 2 سال پیش
والد
کامیت
cc301f9861
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      Userland/DevTools/HackStudio/HackStudioWidget.cpp

+ 1 - 0
Userland/DevTools/HackStudio/HackStudioWidget.cpp

@@ -321,6 +321,7 @@ bool HackStudioWidget::open_file(DeprecatedString const& full_filename, size_t l
 
 
     if (editor_wrapper_or_none.has_value()) {
     if (editor_wrapper_or_none.has_value()) {
         set_current_editor_wrapper(editor_wrapper_or_none.release_value());
         set_current_editor_wrapper(editor_wrapper_or_none.release_value());
+        current_editor().set_cursor(line, column);
         return true;
         return true;
     } else if (active_file().is_empty() && !current_editor().document().is_modified() && !full_filename.is_empty()) {
     } else if (active_file().is_empty() && !current_editor().document().is_modified() && !full_filename.is_empty()) {
         // Replace "Untitled" blank file since it hasn't been modified
         // Replace "Untitled" blank file since it hasn't been modified