Skip to content

Commit 7182675

Browse files
committed
Fix file path completion when projectile is used
When projectile is being used, `projectile-project-files' already returns file paths relative to the project root directory.
1 parent d25f778 commit 7182675

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gdscript-completion.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ first."
7474
(projectile-project-files project-root))
7575
(read-file-name
7676
"Find file: "
77-
project-root))))
78-
(insert
79-
(concat "\"res://"
80-
(gdscript-util--get-godot-project-file-path-relative file)
81-
"." (file-name-extension file) "\"")))))
77+
project-root)))
78+
(resource-path
79+
(if has-projectile
80+
file
81+
(concat (gdscript-util--get-godot-project-file-path-relative file)
82+
"." (file-name-extension file)))))
83+
(insert (concat "\"res://" resource-path "\"")))))
8284

8385

8486
(provide 'gdscript-completion)

0 commit comments

Comments
 (0)