]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix: add comint hook locally in lua-ts-inferior-lua
authornverno <noah.v.peart@gmail.com>
Mon, 4 Dec 2023 03:21:04 +0000 (19:21 -0800)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Dec 2023 09:35:02 +0000 (11:35 +0200)
* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Add
'comint-preoutput-filter-functions' hook locally.  (Bug#67616)

lisp/progmodes/lua-ts-mode.el

index 7307a5b13f19f650b23092523c194aed80d2aaa2..5318144a057483dd493ca7a40f85c07084340c59 100644 (file)
@@ -560,9 +560,7 @@ Calls REPORT-FN directly."
       (comint-read-input-ring t)
       (add-hook 'comint-preoutput-filter-functions
                 (lambda (string)
-                  (if (or (not (equal (buffer-name) lua-ts-inferior-buffer))
-                          (equal string
-                                 (concat lua-ts-inferior-prompt-continue " ")))
+                  (if (equal string (concat lua-ts-inferior-prompt-continue " "))
                       string
                     (concat
                      ;; Filter out the extra prompt characters that
@@ -576,7 +574,8 @@ Calls REPORT-FN directly."
                                                     (group (* nonl))))
                                                "\\1" string)
                      ;; Re-add the prompt for the next line.
-                     lua-ts-inferior-prompt " "))))))
+                     lua-ts-inferior-prompt " ")))
+                nil t)))
   (select-window (display-buffer lua-ts-inferior-buffer
                                  '((display-buffer-reuse-window
                                     display-buffer-pop-up-frame)