Skip to content

Commit

Permalink
fix: Refetch gist buffer if it has not been modified
Browse files Browse the repository at this point in the history
Enable the refetching of the gist in the edit buffer if it has not been modified
  • Loading branch information
KarimAziev committed Mar 21, 2024
1 parent 330f420 commit 70746d3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions igist.el
Original file line number Diff line number Diff line change
Expand Up @@ -3168,10 +3168,16 @@ content."
`((id . ,(or gist-id "newgist"))
(filename . ,filename)))))
(or
(when-let ((buff (and (get-buffer buff-name))))
(and (not (buffer-local-value 'igist-current-gist-error buff))
(buffer-local-value 'igist-edit-mode buff)
buff))
(when-let ((buff (get-buffer buff-name)))
(when (or
(buffer-local-value 'igist-current-gist-loading buff)
(and (buffer-modified-p buff)
(not (buffer-local-value 'igist-current-gist-error buff)))
(not (buffer-local-value 'igist-edit-mode buff)))
(with-current-buffer buff
(igist-setup-local-vars gist filename)
(igist-edit-ensure-edit-mode))
buff))
(let ((url (igist-alist-get-symb 'raw_url gist)))
(with-current-buffer (get-buffer-create buff-name)
(setq igist-current-gist-error nil
Expand Down

0 comments on commit 70746d3

Please sign in to comment.