Skip to content

Commit

Permalink
Merge pull request #750 from Moerliy/lsp-bridge-peek-file-content-scr…
Browse files Browse the repository at this point in the history
…oll-margin

Lsp bridge peek file content scroll margin
  • Loading branch information
manateelazycat committed Oct 24, 2023
2 parents a0a9dca + f4f200f commit f26dc3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ lsp-bridge provides support for more than two language servers for many language
- `lsp-bridge-symbols-enable-which-func`: Using lsp backend for `which-func`, disable by default
- `lsp-bridge-enable-org-babel`: Use lsp completion in org babel, disable by default, if unable to complete, please make sure the string after begin_src exists in the `org-src-lang-modes` variable
- `lsp-bridge-peek-file-content-height`: Display how many lines of file content in peek windows
- `lsp-bridge-peek-file-content-scroll-margin`: Set how many lines of file content should be scroll up and down.
- `lsp-bridge-peek-list-height`: Select the next option for definition and reference
- `lsp-bridge-peek-ace-keys`: Keys to press when performing `lsp-bridge-peek-through`
- `lsp-bridge-peek-ace-cancel-keys`: Keys to exit `lsp-bridge-peek-through`
Expand Down
10 changes: 8 additions & 2 deletions lsp-bridge-peek.el
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ height and background properties of the face."
:type 'integer
:group 'lsp-bridge-peek)


(defcustom lsp-bridge-peek-file-content-scroll-margin 1
"Set how much lsp-bridge-peek-file-content-next-line/-prev-line should scroll up and down."
:type 'integer
:group 'lsp-bridge-peek)

(defcustom lsp-bridge-peek-list-height 3
"Number of definitions/references displayed in the peek window."
:type 'integer
Expand Down Expand Up @@ -659,12 +665,12 @@ When FORCE if non-nil, the content of the peek window is recalculated."
(defun lsp-bridge-peek-file-content-next-line ()
"Step through the next line of file content."
(interactive)
(lsp-bridge-peek-file-content-move 1))
(lsp-bridge-peek-file-content-move lsp-bridge-peek-file-content-scroll-margin))

(defun lsp-bridge-peek-file-content-prev-line ()
"Step through the next line of file content."
(interactive)
(lsp-bridge-peek-file-content-move -1))
(lsp-bridge-peek-file-content-move (* lsp-bridge-peek-file-content-scroll-margin -1)))

(defun lsp-bridge-peek-jump ()
"Jump to where the definition/reference is."
Expand Down

0 comments on commit f26dc3b

Please sign in to comment.