summaryrefslogtreecommitdiff
path: root/helm-bookmark.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-03-01 08:01:49 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-03-01 08:01:49 +0100
commite4cd1beefa06b9010616fed48051830f77191de5 (patch)
tree2c931442612510e7d79c6d07b7cfa74f8436a8ea /helm-bookmark.el
parentfb2d23975bcce6cfcb3fed987f4651c2fb09163b (diff)
Fix Updating keymap with recursive minibuffers.
* helm.el (helm--maybe-update-keymap): Use a timer to setup keymap. The helm buffer may not be ready when changing minibuffer. * helm-bookmark.el (helm-bookmark-toggle-filename-1): New. (helm-bookmark-toggle-filename): Use it.
Diffstat (limited to 'helm-bookmark.el')
-rw-r--r--helm-bookmark.el29
1 files changed, 17 insertions, 12 deletions
diff --git a/helm-bookmark.el b/helm-bookmark.el
index 540acc3a..24fa4ee1 100644
--- a/helm-bookmark.el
+++ b/helm-bookmark.el
@@ -120,22 +120,27 @@
(string-match helm-pattern (bookmark-location candidate))
(string-match helm-pattern candidate)))
+(defun helm-bookmark-toggle-filename-1 (_candidate)
+ (let* ((real (helm-get-selection helm-buffer))
+ (trunc (if (> (string-width real) bookmark-bmenu-file-column)
+ (helm-substring real bookmark-bmenu-file-column)
+ real))
+ (loc (bookmark-location real)))
+ (setq helm-bookmark-show-location (not helm-bookmark-show-location))
+ (helm-force-update (if helm-bookmark-show-location
+ (concat (regexp-quote trunc)
+ " +"
+ (regexp-quote
+ (if (listp loc) (car loc) loc)))
+ real))))
+
(defun helm-bookmark-toggle-filename ()
"Toggle bookmark location visibility."
(interactive)
(with-helm-alive-p
- (let* ((real (helm-get-selection helm-buffer))
- (trunc (if (> (string-width real) bookmark-bmenu-file-column)
- (helm-substring real bookmark-bmenu-file-column)
- real))
- (loc (bookmark-location real)))
- (setq helm-bookmark-show-location (not helm-bookmark-show-location))
- (helm-force-update (if helm-bookmark-show-location
- (concat (regexp-quote trunc)
- " +"
- (regexp-quote
- (if (listp loc) (car loc) loc)))
- real)))))
+ (helm-attrset 'toggle-filename
+ '(helm-bookmark-toggle-filename-1 . never-split))
+ (helm-execute-persistent-action 'toggle-filename)))
(defun helm-bookmark-jump (candidate)
"Jump to bookmark from keyboard."