Skip to content

Commit 942eeec

Browse files
Add an option to display the doc on the left. (#770)
1 parent 547cc35 commit 942eeec

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ Focus into lsp-ui-doc-frame
9494

9595
Customization:
9696

97-
- `lsp-ui-doc-enable` enable lsp-ui-doc
98-
- `lsp-ui-doc-position` Where to display the doc
97+
- `lsp-ui-doc-enable` Enable lsp-ui-doc
98+
- `lsp-ui-doc-position` Where to display the doc (top, bottom or at-point)
99+
- `lsp-ui-doc-side` Where to display the doc (left or right)
99100
- `lsp-ui-doc-delay` Number of seconds before showing the doc
100101
- `lsp-ui-doc-show-with-cursor` When non-nil, move the cursor over a symbol to show the doc
101102
- `lsp-ui-doc-show-with-mouse` When non-nil, move the mouse pointer over a symbol to show the doc

lsp-ui-doc.el

+9-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ This affects the position of the documentation when
9898
(const :tag "At point" at-point))
9999
:group 'lsp-ui-doc)
100100

101+
(defcustom lsp-ui-doc-side 'right
102+
"Which side to display the doc."
103+
:type '(choice (const :tag "Left" left)
104+
(const :tag "Right" right))
105+
:group 'lsp-ui-doc)
106+
101107
(defcustom lsp-ui-doc-alignment 'frame
102108
"How to align the doc.
103109
This only takes effect when `lsp-ui-doc-position' is `top or `bottom."
@@ -545,7 +551,9 @@ FRAME just below the symbol at point."
545551
('window right)))
546552
((left . top) (if (eq lsp-ui-doc-position 'at-point)
547553
(lsp-ui-doc--mv-at-point width height left top)
548-
(cons (max (- frame-right width char-w) 10)
554+
(cons (pcase lsp-ui-doc-side
555+
('right (max (- frame-right width char-w) 10))
556+
('left 10))
549557
(pcase lsp-ui-doc-position
550558
('top (+ top char-w))
551559
('bottom (- (lsp-ui-doc--line-height 'mode-line)

0 commit comments

Comments
 (0)