Skip to content

Commit

Permalink
Merge pull request #145 from NicolasPetton/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Apr 24, 2024
2 parents cd92e12 + 7182675 commit 2737f1c
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions gdscript-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,24 @@ first."
(let ((has-projectile (featurep 'projectile)))
(when has-projectile
(projectile-maybe-invalidate-cache arg))
(let* ((project-root
(if has-projectile
(projectile-ensure-project (projectile-project-root))
(gdscript-util--find-project-configuration-file)))
(file
(if has-projectile
(projectile-completing-read
"Find file: "
(projectile-project-files project-root))
(read-file-name
"Find file: "
project-root))))
(when file
(insert
(concat "\"res://"
(gdscript-util--get-godot-project-file-path-relative file)
"." (file-name-extension file) "\""))))))
(when-let* ((project-root
(if has-projectile
(projectile-ensure-project (projectile-project-root))
(gdscript-util--find-project-configuration-file)))
(file
(if has-projectile
(projectile-completing-read
"Find file: "
(projectile-project-files project-root))
(read-file-name
"Find file: "
project-root)))
(resource-path
(if has-projectile
file
(concat (gdscript-util--get-godot-project-file-path-relative file)
"." (file-name-extension file)))))
(insert (concat "\"res://" resource-path "\"")))))


(provide 'gdscript-completion)
Expand Down

0 comments on commit 2737f1c

Please sign in to comment.