[gnome-builder/wip/gtk4-port] libide/lsp: port search result to libide-search



commit a555fa64862b7f0638184f474576bc3254874320
Author: Christian Hergert <chergert redhat com>
Date:   Sun Apr 3 16:23:30 2022 -0700

    libide/lsp: port search result to libide-search

 src/libide/lsp/ide-lsp-search-result.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/lsp/ide-lsp-search-result.c b/src/libide/lsp/ide-lsp-search-result.c
index cf300f11f..29d7e4f49 100644
--- a/src/libide/lsp/ide-lsp-search-result.c
+++ b/src/libide/lsp/ide-lsp-search-result.c
@@ -18,9 +18,12 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
+#define G_LOG_DOMAIN "ide-lsp-search-result"
+
 #include "config.h"
 
 #include "ide-lsp-search-result.h"
+
 #include <libide-core.h>
 #include <libide-editor.h>
 
@@ -109,17 +112,17 @@ ide_lsp_search_result_activate (IdeSearchResult *result,
 
   IdeLspSearchResult *self = (IdeLspSearchResult *)result;
   IdeWorkspace *workspace;
-  IdeSurface *editor;
+  IdeFrame *frame;
 
   g_assert (IDE_IS_LSP_SEARCH_RESULT (self));
   g_assert (GTK_IS_WIDGET (last_focus));
 
-  if (!last_focus)
+  if (!last_focus ||
+      !(workspace = ide_widget_get_workspace (last_focus)))
     return;
 
-  if ((workspace = ide_widget_get_workspace (last_focus)) &&
-      (editor = ide_workspace_get_surface_by_name (workspace, "editor")))
-    ide_editor_surface_focus_location (IDE_EDITOR_SURFACE (editor), self->location);
+  frame = ide_workspace_get_most_recent_frame (workspace);
+  ide_editor_focus_location (workspace, frame, self->location);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]