Skip to content

Commit

Permalink
Fix out-of-bounds access (emacs-lsp#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiansturm committed Aug 31, 2020
1 parent 4cdb739 commit 5b1d0da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lsp-ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
:type '(repeat integer))

(defcustom lsp-ivy-symbol-kind-to-face
[(" " . nil) ;; Unknown - 0
[(" " . nil) ;; Unknown - 0
("File" . font-lock-builtin-face) ;; File - 1
("Modu" . font-lock-keyword-face) ;; Module - 2
("Nmsp" . font-lock-keyword-face) ;; Namespace - 3
Expand Down Expand Up @@ -137,7 +137,8 @@
((&SymbolInformation :name :kind :container-name? :location (&Location :uri))
project-root)
"Convert the match returned by `lsp-mode` into a candidate string."
(let* ((type (elt lsp-ivy-symbol-kind-to-face kind))
(let* ((sanitized-kind (if (< kind (length lsp-ivy-symbol-kind-to-face)) kind 0))
(type (elt lsp-ivy-symbol-kind-to-face sanitized-kind))
(typestr (if lsp-ivy-show-symbol-kind
(propertize (format "[%s] " (car type)) 'face (cdr type))
""))
Expand Down

0 comments on commit 5b1d0da

Please sign in to comment.