Skip to content

Commit d25f778

Browse files
committed
Use when-let in gdscript-completion-insert-file-path-at-point
1 parent b8a8404 commit d25f778

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

gdscript-completion.el

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,22 @@ first."
6363
(let ((has-projectile (featurep 'projectile)))
6464
(when has-projectile
6565
(projectile-maybe-invalidate-cache arg))
66-
(let* ((project-root
67-
(if has-projectile
68-
(projectile-ensure-project (projectile-project-root))
69-
(gdscript-util--find-project-configuration-file)))
70-
(file
71-
(if has-projectile
72-
(projectile-completing-read
73-
"Find file: "
74-
(projectile-project-files project-root))
75-
(read-file-name
76-
"Find file: "
77-
project-root))))
78-
(when file
79-
(insert
80-
(concat "\"res://"
81-
(gdscript-util--get-godot-project-file-path-relative file)
82-
"." (file-name-extension file) "\""))))))
66+
(when-let* ((project-root
67+
(if has-projectile
68+
(projectile-ensure-project (projectile-project-root))
69+
(gdscript-util--find-project-configuration-file)))
70+
(file
71+
(if has-projectile
72+
(projectile-completing-read
73+
"Find file: "
74+
(projectile-project-files project-root))
75+
(read-file-name
76+
"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) "\"")))))
8382

8483

8584
(provide 'gdscript-completion)

0 commit comments

Comments
 (0)