From 360e9bec33862bde60874de81efbdfa8f4a8e6a8 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Thu, 18 Feb 2021 23:52:10 -0600 Subject: [PATCH] Ticket # 4207: (editcmd_dialog_select_definition_show): fix "Find declaration" disrupting file's path. Signed-off-by: Andrew Borodin --- src/editor/editcmd_dialogs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index b0caf0036..764a09a7e 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -483,7 +483,9 @@ editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_l { vfs_path_free (edit_history_moveto[edit_stack_iterator].filename_vpath); - if (edit->dir_vpath != NULL) + /* Is file path absolute? Prepend with dir_vpath if necessary */ + if (edit->filename_vpath != NULL && edit->filename_vpath->relative + && edit->dir_vpath != NULL) edit_history_moveto[edit_stack_iterator].filename_vpath = vfs_path_append_vpath_new (edit->dir_vpath, edit->filename_vpath, NULL); else