branch: externals/ellama commit 7120417f7c4adf501cf5e0d659d5ac5c75ebc2d5 Merge: 90196c304c 002fa8ebd2 Author: Sergey Kostyaev <s-kosty...@users.noreply.github.com> Commit: GitHub <nore...@github.com>
Merge pull request #215 from s-kostyaev/fix-reset-session-context Clear session context on reset command --- NEWS.org | 3 +++ ellama.el | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.org b/NEWS.org index 359fbeb715..3a2a696fa7 100644 --- a/NEWS.org +++ b/NEWS.org @@ -1,3 +1,6 @@ +* Version 1.1.2 +- Clear session context on calling reset context commant to prevent + suprising behaviour. * Version 1.1.1 - Improve ~ellama-add-selection~. - Add buffer quote context element. diff --git a/ellama.el b/ellama.el index 762c758c77..ae7c8ff0c8 100644 --- a/ellama.el +++ b/ellama.el @@ -6,7 +6,7 @@ ;; URL: http://github.com/s-kostyaev/ellama ;; Keywords: help local tools ;; Package-Requires: ((emacs "28.1") (llm "0.22.0") (spinner "1.7.4") (transient "0.7") (compat "29.1") (posframe "1.4.0")) -;; Version: 1.1.1 +;; Version: 1.1.2 ;; SPDX-License-Identifier: GPL-3.0-or-later ;; Created: 8th Oct 2023 @@ -1042,6 +1042,9 @@ If EPHEMERAL non nil new session will not be associated with any file." (setq ellama--global-context nil) (with-current-buffer ellama--context-buffer (erase-buffer)) + (when ellama--current-session-id + (with-current-buffer (ellama-get-session-buffer ellama--current-session-id) + (setf (ellama-session-context ellama--current-session) nil))) (posframe-hide ellama--context-buffer)) ;; Context elements