Merge pull request #113 from bandresen/irc-pr
app/irc: minor ivy bug fix + evil improvement
This commit is contained in:
commit
fcf78cebd1
2 changed files with 15 additions and 3 deletions
|
@ -62,7 +62,14 @@ argument) is non-nil only show channels in current server."
|
||||||
(cl-loop for buf in (circe-server-chat-buffers)
|
(cl-loop for buf in (circe-server-chat-buffers)
|
||||||
unless (eq buf current-buffer)
|
unless (eq buf current-buffer)
|
||||||
collect (format " %s" (buffer-name buf)))))
|
collect (format " %s" (buffer-name buf)))))
|
||||||
:action #'ivy--switch-buffer-action
|
:action #'+irc--ivy-switch-to-buffer-action
|
||||||
:preselect (buffer-name (current-buffer))
|
:preselect (buffer-name (current-buffer))
|
||||||
:keymap ivy-switch-buffer-map
|
:keymap ivy-switch-buffer-map
|
||||||
:caller '+irc/ivy-jump-to-channel)))
|
:caller '+irc/ivy-jump-to-channel)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +irc--ivy-switch-to-buffer-action (buffer)
|
||||||
|
(when (stringp buffer)
|
||||||
|
(if (get-buffer buffer)
|
||||||
|
(ivy--switch-buffer-action buffer)
|
||||||
|
(ivy--switch-buffer-action (s-trim-left buffer)))))
|
||||||
|
|
|
@ -114,9 +114,14 @@ playback.")
|
||||||
;; Let `+irc/quit' and `circe' handle buffer cleanup
|
;; Let `+irc/quit' and `circe' handle buffer cleanup
|
||||||
(map! :map circe-mode-map [remap doom/kill-this-buffer] #'bury-buffer)
|
(map! :map circe-mode-map [remap doom/kill-this-buffer] #'bury-buffer)
|
||||||
|
|
||||||
;; Ensure entering insert mode will put us at the prompt.
|
;; Ensure entering insert mode will put us at the prompt,
|
||||||
|
;; unless editing after prompt marker.
|
||||||
|
(defun +irc-evil-insert ()
|
||||||
|
(when (> (marker-position lui-input-marker) (point))
|
||||||
|
(end-of-buffer)))
|
||||||
|
|
||||||
(add-hook! 'lui-mode-hook
|
(add-hook! 'lui-mode-hook
|
||||||
(add-hook 'evil-insert-state-entry-hook #'end-of-buffer nil t)))
|
(add-hook 'evil-insert-state-entry-hook #'+irc-evil-insert nil t)))
|
||||||
|
|
||||||
(after! solaire-mode
|
(after! solaire-mode
|
||||||
;; distinguish chat/channel buffers from server buffers.
|
;; distinguish chat/channel buffers from server buffers.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue