diff --git a/counsel-tramp.el b/counsel-tramp.el index 49d7f7f..b00598c 100644 --- a/counsel-tramp.el +++ b/counsel-tramp.el @@ -1,10 +1,10 @@ ;;; counsel-tramp.el --- Tramp ivy interface for ssh, docker, vagrant -*- lexical-binding: t; -*- -;; Copyright (C) 2017 by Masashı Mıyaura +;; Copyright (C) 2017-2018 by Masashı Mıyaura ;; Author: Masashı Mıyaura ;; URL: https://github.com/masasam/emacs-counsel-tramp -;; Version: 0.3.1 +;; Version: 0.4.1 ;; Package-Requires: ((emacs "24.3") (counsel "0.10")) ;; This program is free software; you can redistribute it and/or modify @@ -85,12 +85,22 @@ Kill all remote buffers." (if (string-match "\\`[ \t\n\r]+" host) (replace-match "" t t host)) (unless (string= host "*") - (push - (concat "/" tramp-default-method ":" host ":") - hosts) - (push - (concat "/ssh:" host "|sudo:root@" host ":/") - hosts)))) + (if (string-match "[ ]+" host) + (let ((result (split-string host " "))) + (while result + (push + (concat "/" tramp-default-method ":" (car result) ":") + hosts) + (push + (concat "/ssh:" (car result) "|sudo:root@" (car result) ":/") + hosts) + (pop result))) + (push + (concat "/" tramp-default-method ":" host ":") + hosts) + (push + (concat "/ssh:" host "|sudo:root@" host ":/") + hosts))))) (when (package-installed-p 'docker-tramp) (cl-loop for line in (cdr (ignore-errors (apply #'process-lines "docker" (list "ps")))) for info = (reverse (split-string line "[[:space:]]+" t))