emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.03k stars 141 forks source link

Allow customisation for `lsp-ui-imenu` buffer position. #717

Closed DivvyCr closed 2 years ago

DivvyCr commented 2 years ago

There should be a customisable option for positioning the imenu buffer on either side of the screen. Unless there are any specific reasons against positioning it on the left?

Now, I'm not at all well-versed in elisp, but the following seems to work for me:

 (defcustom lsp-ui-imenu-buffer-position 'right
   "Where to place the `lsp-ui-imenu' buffer."
   :type '(choice (const :tag "Left" left)
          (const :tag "Right" right))
   :group 'lsp-ui-imenu)

And then, on line 298:

(display-buffer-in-side-window imenu-buffer '(if (eq lsp-ui-imenu-buffer-position 'left) (side . left) (side . right)))
jcs090218 commented 2 years ago

I don't see a reason to block this. Can you open a PR for this?

I might suggest go one level down to,

`((side . ,(if (eq lsp-ui-imenu-buffer-position 'left) 'left 'right)))