(if (member ivy-text ivy--all-candidates)
(ivy--cd (expand-file-name ivy-text ivy--directory))
(when (string-match "//\\'" ivy-text)
- (ivy--cd "/")))
+ (if (and default-directory
+ (string-match "[[:alpha:]]:/" default-directory))
+ (ivy--cd (match-string 0 default-directory))
+ (ivy--cd "/")))
+ (when (string-match "[[:alpha:]]:/" ivy-text)
+ (let ((drive-root (match-string 0 ivy-text)))
+ (when (file-exists-p drive-root)
+ (ivy--cd drive-root)))))
(if (string-match "~\\'" ivy-text)
(ivy--cd (expand-file-name "~/")))))
((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)