Skip to content

Commit

Permalink
nit(core): simplify a condition
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Apr 29, 2023
1 parent f38adf1 commit 4a82a91
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions elisp/+io.el
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation."
"Open the current file as root."
(interactive)
(if-let ((this-file (or buffer-file-name
(when (or (derived-mode-p 'dired-mode)
(derived-mode-p 'wdired-mode))
(when (derived-mode-p 'dired-mode 'wdired-mode)
default-directory))))
(find-file (+tramp-sudo-file-path this-file))
(user-error "Current buffer not bound to a file")))
Expand Down

0 comments on commit 4a82a91

Please sign in to comment.