Skip to content

Commit

Permalink
fix for .steampath
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Jul 23, 2023
1 parent d93fc61 commit 5d90d65
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions src/ext/directory-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -184,41 +184,43 @@
t)))))

(defun insert-pathname (point pathname directory &optional content)
(with-point ((start point))
(let ((name (or content (namestring (enough-namestring pathname directory)))))
(insert-string point " " 'pathname pathname 'name name)
(insert-string point
(format nil " ~5@A "
(let ((size (file-size pathname)))
(if size (human-readable-file-size size) "")))
:attribute 'file-size-attribute)
(multiple-value-bind (second minute hour day month year week)
(let ((date (file-write-date pathname)))
(if date
(decode-universal-time date)
(values 0 0 0 0 0 0 nil)))
(let ((file-size (handler-case (file-size pathname)
(error ()
(return-from insert-pathname)))))
(with-point ((start point))
(let ((name (or content (namestring (enough-namestring pathname directory)))))
(insert-string point " " 'pathname pathname 'name name)
(insert-string point
(format nil "~4,'0D/~2,'0D/~2,'0D ~2,'0D:~2,'0D:~2,'0D ~A "
year month day hour minute second
(if week (aref #("Mon" "Tue" "Wed" "Thr" "Fri" "Sat" "Sun") week)
" "))
:attribute 'file-date-attribute))
(unless (string= name "..")
(insert-icon point name))
(insert-string point
name
:attribute (get-file-attribute pathname)
:file pathname)
(when (symbolic-link-p pathname)
(insert-string point (format nil " -> ~A" (probe-file pathname))))
(back-to-indentation start)
(lem/button:apply-button-between-points
start point
(lambda ()
(lem/button:with-context ()
(directory-mode-find-file))))
(insert-character point #\newline)
(put-text-property start point :read-only t))))
(format nil " ~5@A "
(if file-size (human-readable-file-size file-size) ""))
:attribute 'file-size-attribute)
(multiple-value-bind (second minute hour day month year week)
(let ((date (file-write-date pathname)))
(if date
(decode-universal-time date)
(values 0 0 0 0 0 0 nil)))
(insert-string point
(format nil "~4,'0D/~2,'0D/~2,'0D ~2,'0D:~2,'0D:~2,'0D ~A "
year month day hour minute second
(if week (aref #("Mon" "Tue" "Wed" "Thr" "Fri" "Sat" "Sun") week)
" "))
:attribute 'file-date-attribute))
(unless (string= name "..")
(insert-icon point name))
(insert-string point
name
:attribute (get-file-attribute pathname)
:file pathname)
(when (symbolic-link-p pathname)
(insert-string point (format nil " -> ~A" (probe-file pathname))))
(back-to-indentation start)
(lem/button:apply-button-between-points
start point
(lambda ()
(lem/button:with-context ()
(directory-mode-find-file))))
(insert-character point #\newline)
(put-text-property start point :read-only t)))))

(defun insert-directories-and-files (point
directory
Expand Down

0 comments on commit 5d90d65

Please sign in to comment.