Skip to content

Commit 3632ddd

Browse files
authored
Allow customisation for the imenu buffer position. (#718)
1 parent a0b97db commit 3632ddd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lsp-ui-imenu.el

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
(const :tag "Left" left))
5757
:group 'lsp-ui-imenu)
5858

59+
(defcustom lsp-ui-imenu-buffer-position 'right
60+
"Where to place the `lsp-ui-imenu' buffer."
61+
:type '(choice (const :tag "Left" left)
62+
(const :tag "Right" right))
63+
:group 'lsp-ui-imenu)
64+
5965
(defcustom lsp-ui-imenu-colors '("deep sky blue" "green3")
6066
"Color list to cycle through for entry groups."
6167
:type '(repeat color)
@@ -295,7 +301,10 @@ ITEMS are used when the kind position is 'left."
295301
(imenu--make-index-alist)
296302
(let ((imenu-buffer (get-buffer-create lsp-ui-imenu-buffer-name)))
297303
(lsp-ui-imenu--refresh-content)
298-
(let ((win (display-buffer-in-side-window imenu-buffer '((side . right)))))
304+
(let ((win (display-buffer-in-side-window imenu-buffer
305+
`((side . ,(if (eq lsp-ui-imenu-buffer-position 'left)
306+
'left
307+
'right))))))
299308
(set-window-margins win 1)
300309
(select-window win)
301310
(set-window-start win 1)

0 commit comments

Comments
 (0)