Skip to content

Commit

Permalink
Deal with breaking change to `helm-display-function'
Browse files Browse the repository at this point in the history
* This function now has an additional optional arg, `RESUME'.

* Make `helm-swoop-split-window-function' customizable, and move
  the previous default lambda value to a named function,
  `helm-swoop--split-window-default'.

* Fixes emacsorphanage#123
  • Loading branch information
jguenther committed Jan 22, 2018
1 parent 66a9517 commit 2d127b2
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions helm-swoop.el
Expand Up @@ -140,16 +140,21 @@
"If t, use fuzzy matching functions as well as exact matches."
:group 'helm-swoop :type 'boolean)

(defvar helm-swoop-split-window-function
(lambda ($buf)
(if helm-swoop-split-with-multiple-windows
(funcall helm-swoop-split-direction)
(when (one-window-p)
(funcall helm-swoop-split-direction)))
(other-window 1)
(switch-to-buffer $buf))
"Change the way to split window only when `helm-swoop' is calling")
(defun helm-swoop--split-window-default ($buf &optional resume)
"Split window according to `helm-swoop-split-with-multiple-windows'
and `helm-swoop-split-direction' settings."
(if helm-swoop-split-with-multiple-windows
(funcall helm-swoop-split-direction)
(when (one-window-p)
(funcall helm-swoop-split-direction)))
(other-window 1)
(switch-to-buffer $buf)
)

(defcustom helm-swoop-split-window-function #'helm-swoop--split-window-default
"Function to use as `helm-display-function'."
:group 'helm-swoop
:type 'function)
(defcustom helm-swoop-after-goto-line-action-hook nil
"hooks run after `helm-swoop--goto-line"
:group 'helm-swoop
Expand Down Expand Up @@ -685,6 +690,7 @@ If $linum is number, lines are separated by $linum"
(or $source
(helm-c-source-swoop))
:buffer helm-swoop-buffer
:display-function helm-swoop-split-window-function
:input $query
:prompt helm-swoop-prompt
:preselect
Expand Down Expand Up @@ -1162,6 +1168,7 @@ If $linum is number, lines are separated by $linum"
(helm-completion-window-scroll-margin 5))
(helm :sources $contents
:buffer helm-multi-swoop-buffer
:display-function helm-swoop-split-window-function
:input (or $query helm-multi-swoop-query "")
:prompt helm-swoop-prompt
:candidate-number-limit
Expand Down

0 comments on commit 2d127b2

Please sign in to comment.