Skip to content

Commit

Permalink
Fail gracefully when operating on the empty line at end of list
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Aug 18, 2023
1 parent 4f93fe2 commit f7b1e71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion justl.el
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,10 @@ not executed."

(defun justl--get-recipe-under-cursor ()
"Utility function to get the name of the recipe under the cursor."
(get-text-property 0 'recipe (aref (tabulated-list-get-entry) 0)))
(let ((entry (tabulated-list-get-entry)))
(if entry
(get-text-property 0 'recipe (aref entry 0))
(user-error "There is no recipe on the current line"))))

(defun justl--refresh-buffer ()
"Refresh justl buffer."
Expand Down

0 comments on commit f7b1e71

Please sign in to comment.