diff --git a/CHANGELOG.md b/CHANGELOG.md index a86db6d..a115537 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Fixed +* Slow startup/freezing on large directories + ## [0.1.0] - 2020-01-12 diff --git a/README.md b/README.md index e917f0f..4843fe7 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Run it from a text file containing one file name per line to open the listed fil 7. What should be the behavior when we open Dired-marked files, then mark files within sxiv? ## Limitations -* Currently falls flat if run in directories with a huge number of images. * `sxiv-dired-marked-files-p` doesn't work as intended with non '*' markers (e.g. C or D) ## Comparison with [picpocket](https://github.com/johanclaesson/picpocket) diff --git a/sxiv.el b/sxiv.el index 44b8d92..d116d5c 100644 --- a/sxiv.el +++ b/sxiv.el @@ -75,21 +75,14 @@ the files listed." (recurse (or prefix (-every? #'file-directory-p paths))) ;; remove directories if not running recursively - (paths (->> (if recurse - paths - (seq-remove #'file-directory-p paths)) - (mapcar #'shell-quote-argument) - (--reduce (concat acc " " it)))) + (paths (if recurse + paths + (seq-remove #'file-directory-p paths))) (recurse (if recurse "-r" "")) (proc (make-process :name "sxiv" :buffer "sxiv" :command - (list shell-file-name - shell-command-switch - (concat "sxiv -afo " - recurse - " -- " - paths)) + (apply #'list "sxiv" "-afo" recurse "--" paths) :connection-type 'pipe :stderr "sxiv-errors"))) (setq sxiv--directory default-directory)