Fix nil error in +ivy/jump-list for empty buffers

For empty buffers which don't have any lines, `(thing-at-point 'line)`
will return `nil`. This broke `+ivy/jump-list`.
This commit is contained in:
Benno Fünfstück 2019-11-04 11:57:52 +01:00
parent 95c3682716
commit 31b2a5a19e

View file

@ -513,7 +513,7 @@ If ALL-FILES-P, search compressed and hidden files as well."
(cons (format "%s:%d: %s"
(buffer-name)
(line-number-at-pos)
(string-trim-right (thing-at-point 'line)))
(string-trim-right (or (thing-at-point 'line) "<EMPTY BUFFER>")))
(point-marker)))))))
(cddr (better-jumper-jump-list-struct-ring
(better-jumper-get-jumps (better-jumper--get-current-context))))))))