Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/ext/directory-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,19 @@
(update (current-buffer)))

(define-command directory-mode-up-directory () ()
(switch-to-buffer
(directory-buffer
(uiop:pathname-parent-directory-pathname
(buffer-directory)))))
(let ((dir (buffer-directory)))
(switch-to-buffer
(directory-buffer (uiop:pathname-parent-directory-pathname (buffer-directory))))
(search-filename-and-recenter
(concatenate
'string
(car
(reverse
(split-sequence:split-sequence
(uiop:directory-separator-for-host)
dir
:remove-empty-subseqs t)))
(string (uiop:directory-separator-for-host))))))

(define-command directory-mode-find-file () ()
(process-current-line-pathname 'find-file))
Expand Down Expand Up @@ -653,6 +662,8 @@ With prefix argument ARG, unmark all those files."
"Open this file's directory and place point on the filename."
(let ((fullpath (buffer-filename)))
(cond
((mode-active-p (current-buffer) 'directory-mode)
(directory-mode-up-directory))
((null fullpath)
(message "No file at point"))
(t
Expand All @@ -678,3 +689,5 @@ This does not delete the marked entries, but only remove them from the buffer."
(defmethod execute :after ((mode directory-mode) command argument)
(when (mode-active-p (current-buffer) 'directory-mode)
(update-line (current-point))))