fix(beancount): beancount-fava failing to open browser
This commit is contained in:
parent
3391cb76bb
commit
90bbd7101a
1 changed files with 11 additions and 0 deletions
|
@ -15,6 +15,17 @@
|
|||
(when (modulep! +lsp)
|
||||
(add-hook 'beancount-mode-local-vars-hook #'lsp! 'append))
|
||||
|
||||
;; HACK: The intro message changed in newer versions of Fava, plus, the output
|
||||
;; could contain ANSI codes, causing the `beancount-fava' command to not
|
||||
;; open the server in the browser after the server has started.
|
||||
;; REVIEW: PR this uptsream!
|
||||
(defadvice! +beancount--open-in-browser-after-starting-fix-a (_process output)
|
||||
:override #'beancount--fava-filter
|
||||
(save-match-data
|
||||
(let ((output (ansi-color-filter-apply output)))
|
||||
(when-let ((url (string-match "\\(?:Starting\\|Running\\) Fava on \\(http://.+:[0-9]+\\)\n" output)))
|
||||
(browse-url (match-string 1 output))))))
|
||||
|
||||
(map! :map beancount-mode-map
|
||||
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
|
||||
#'beancount-outline-cycle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue