emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/eat b42687f146 5/9: Fix prompt navigation when annotation


From: ELPA Syncer
Subject: [nongnu] elpa/eat b42687f146 5/9: Fix prompt navigation when annotation is disabled
Date: Tue, 6 Dec 2022 13:58:46 -0500 (EST)

branch: elpa/eat
commit b42687f1466f48bfb3453d55441f98e30fba8e98
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Fix prompt navigation when annotation is disabled
    
    * eat.el (eat--pre-prompt): Always set
    'eat--shell-prompt-begin'.
    * eat.el (eat--post-prompt): Always put special prompt end
    marking text property.
---
 eat.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/eat.el b/eat.el
index e00bf649a7..9853c7e75c 100644
--- a/eat.el
+++ b/eat.el
@@ -4241,8 +4241,7 @@ If HOST isn't the host Emacs is running on, don't do 
anything."
 
 (defun eat--pre-prompt (_)
   "Save the beginning position of shell prompt."
-  (when eat-enable-shell-prompt-annotation
-    (setq eat--shell-prompt-begin (point-marker))))
+  (setq eat--shell-prompt-begin (point-marker)))
 
 (defun eat--post-prompt (_)
   "Put a mark in the marginal area on current line."
@@ -4279,11 +4278,13 @@ If HOST isn't the host Emacs is running on, don't do 
anything."
              (list 'eat--before-string before-str
                    'eat--shell-prompt-mark-id identifier
                    'eat--shell-prompt-mark-overlay ov))
-            (push ov eat--shell-prompt-mark-overlays))
-          ;; Put a text property to allow previous or next prompts.
-          (put-text-property (1- (point)) (point)
-                             'eat--shell-prompt-end t))
-        (setq eat--shell-prompt-begin nil)))))
+            (push ov eat--shell-prompt-mark-overlays)))
+        (setq eat--shell-prompt-begin nil))))
+  (when eat--shell-prompt-begin
+    (when (< eat--shell-prompt-begin (point))
+      ;; Put a text property to allow previous or next prompts.
+      (put-text-property (1- (point)) (point)
+                         'eat--shell-prompt-end t))))
 
 (defun eat--update-shell-prompt-mark-overlays (buffer)
   "Update all overlays used to add mark before shell prompt.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]