Skip to content

Commit 0a6368d

Browse files
DivvyCrbrotzeit
authored andcommitted
Refactor imenu option to fix window width, and add note.
1 parent 267a2c9 commit 0a6368d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Customization:
111111
- `lsp-ui-imenu-kind-position` place to show entries kind
112112
- `lsp-ui-imenu-buffer-position` place to show the buffer window
113113
- `lsp-ui-imenu-window-width` set window width
114+
- `lsp-ui-imenu-window-fix-width` when non-nil, the window will not be resizable (eg. unaffected by `balance-windows`)
114115
- `lsp-ui-imenu--custom-mode-line-format` mode line format
115116
- `lsp-ui-imenu-auto-refresh` auto refresh when necessary
116117
- `lsp-ui-imenu-refresh-delay` delay to refresh imenu

lsp-ui-imenu.el

+7-7
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@
6262
(const :tag "Right" right))
6363
:group 'lsp-ui-imenu)
6464

65-
(defcustom lsp-ui-imenu-persistent-buffer nil
66-
"If non-nil, the `lsp-ui-imenu' buffer will permanently maintain its size.
67-
ie. it will not be affected by `balance-windows' etc."
68-
:type 'boolean
69-
:group 'lsp-ui-imenu)
70-
7165
(defcustom lsp-ui-imenu-colors '("deep sky blue" "green3")
7266
"Color list to cycle through for entry groups."
7367
:type '(repeat color)
@@ -78,6 +72,12 @@ ie. it will not be affected by `balance-windows' etc."
7872
:type 'number
7973
:group 'lsp-ui-imenu)
8074

75+
(defcustom lsp-ui-imenu-window-fix-width nil
76+
"If non-nil, the `lsp-ui-imenu' window will permanently maintain its width.
77+
ie. it will not be affected by `balance-windows' etc."
78+
:type 'boolean
79+
:group 'lsp-ui-imenu)
80+
8181
(defcustom lsp-ui-imenu-auto-refresh nil
8282
"Automatically refresh imenu when certain conditions meet."
8383
:type '(choice (const :tag "Enable" t)
@@ -386,7 +386,7 @@ ITEMS are used when the kind position is 'left."
386386

387387
(define-derived-mode lsp-ui-imenu-mode special-mode "lsp-ui-imenu"
388388
"Mode showing imenu entries."
389-
(setq window-size-fixed (if lsp-ui-imenu-persistent-buffer 'width nil)))
389+
(setq window-size-fixed (if lsp-ui-imenu-window-fix-width 'width nil)))
390390

391391
(defun lsp-ui-imenu--refresh ()
392392
"Safe refresh imenu content."

0 commit comments

Comments
 (0)