Skip to content

Commit ab081b2

Browse files
stardivinerexpez
authored andcommitted
[Fix #388] Make ensure-no-dashes more robust
1 parent b230432 commit ab081b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clj-refactor.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,8 @@ word test in it and whether the file lives under the test/ directory."
10731073
file-name))
10741074

10751075
(defun cljr--ensure-no-dashes-in-filename ()
1076-
(when (and (not (file-exists-p (buffer-file-name))) ; only new files
1076+
(when (and (buffer-file-name)
1077+
(not (file-exists-p (buffer-file-name))) ; only new files
10771078
(cljr--dash-in-file-name-p (buffer-file-name)))
10781079
(let ((new-name (cljr--maybe-replace-dash-in-file-name (buffer-file-name))))
10791080
(rename-buffer new-name)

0 commit comments

Comments
 (0)