Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/fix-annotation-command-bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Dec 7, 2023
2 parents 3055ab4 + 5763fd3 commit 23a7e66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 5 additions & 1 deletion source/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,11 @@ invoked via " (:code "flatpak-spawn --host <command> <command-args>") "."))))
(:nsection :title "UI/UX"
(:ul
(:li "Improve source heading buttons, layout and interactions in the "
(:nxref :class-name 'prompt-buffer) "."))))
(:nxref :class-name 'prompt-buffer) ".")))
(:nsection :title "Bug fixes"
(:ul
(:li "Fix command "
(:nxref :command 'nyxt/mode/annotate:show-annotations-for-current-url) "."))))

(define-version "4-pre-release-1"
(:li "When on pre-release, push " (:code "X-pre-release")
Expand Down
11 changes: 5 additions & 6 deletions source/mode/annotate.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ make-instance."

(define-internal-page show-annotations-for-current-url (&key (id (id (current-buffer))))
(:title "*Annotations*")
"Create a new buffer with the annotations of the current URL of BUFFER."
(let ((source-buffer (nyxt::buffers-get id))
(annotations (files:content (annotations-file buffer))))
(let ((filtered-annotations (sera:filter (curry #'url-equal (url source-buffer))
annotations :key #'url)))
(render-annotations filtered-annotations))))
"Display the annotations associated to buffer with ID."
(let ((buffer (nyxt::buffers-get id)))
(render-annotations (sera:filter (curry #'url-equal (url buffer))
(files:content (annotations-file buffer))
:key (compose #'quri:uri #'url)))))

(define-command-global show-annotations-for-current-url (&key (buffer (current-buffer)))
"Create a new buffer with the annotations of the current URL of BUFFER."
Expand Down

0 comments on commit 23a7e66

Please sign in to comment.