Skip to content

Commit

Permalink
Fix error related to buffer-names introduced by (#934).
Browse files Browse the repository at this point in the history
* helm-buffers.el (helm-buffers--quote-truncated-buffer,
helm-buffer--get-preselection): Transform argument in buffer-name.
  • Loading branch information
thierryvolpiatto committed Mar 26, 2015
1 parent df81970 commit e3d52cb
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions helm-buffers.el
Expand Up @@ -361,18 +361,19 @@ Should be called after others transformers i.e (boring buffers)."
name)
(get-buffer i))))

(defun helm-buffer--get-preselection (buffer-name)
(concat "^"
(if (and (null helm-buffer-details-flag)
(numberp helm-buffer-max-length)
(> (string-width buffer-name)
helm-buffer-max-length))
(regexp-quote
(helm-substring-by-width
buffer-name helm-buffer-max-length))
(concat (regexp-quote buffer-name)
(if helm-buffer-details-flag
"$" "[[:blank:]]+")))))
(defun helm-buffer--get-preselection (buffer)
(let ((bufname (buffer-name buffer)))
(concat "^"
(if (and (null helm-buffer-details-flag)
(numberp helm-buffer-max-length)
(> (string-width bufname)
helm-buffer-max-length))
(regexp-quote
(helm-substring-by-width
bufname helm-buffer-max-length))
(concat (regexp-quote bufname)
(if helm-buffer-details-flag
"$" "[[:blank:]]+"))))))

(defun helm-toggle-buffers-details ()
(interactive)
Expand Down Expand Up @@ -683,13 +684,14 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
(with-helm-temp-hook 'helm-after-persistent-action-hook
(helm-force-update (regexp-quote (helm-get-selection nil t)))))

(defun helm-buffers--quote-truncated-buffer (bufname)
(regexp-quote
(if helm-buffer-max-length
(helm-substring-by-width
bufname helm-buffer-max-length
"")
bufname)))
(defun helm-buffers--quote-truncated-buffer (buffer)
(let ((bufname (buffer-name buffer)))
(regexp-quote
(if helm-buffer-max-length
(helm-substring-by-width
bufname helm-buffer-max-length
"")
bufname))))

(defun helm-buffers-persistent-kill (_buffer)
(let ((marked (helm-marked-candidates)))
Expand Down

0 comments on commit e3d52cb

Please sign in to comment.