mirror of
https://github.com/vale981/py-vterm-interaction.el
synced 2025-03-04 17:41:40 -05:00
Fix regexp to get the last non-empty line
This commit is contained in:
parent
f84208434d
commit
8eff5bde44
1 changed files with 5 additions and 1 deletions
|
@ -195,7 +195,11 @@ Return a corresponding symbol or nil if not ready for input."
|
|||
(let* ((bs (buffer-string))
|
||||
(tail (substring bs (- (min 256 (length bs))))))
|
||||
(set-text-properties 0 (length tail) nil tail)
|
||||
(let* ((lines (split-string (string-trim-right tail "[\t\n\r]+")
|
||||
(let* ((lines (split-string (string-trim-right
|
||||
(replace-regexp-in-string
|
||||
(rx (1+ bol (0+ whitespace) eol))
|
||||
"" tail)
|
||||
"[\t\n\r]+")
|
||||
(char-to-string ?\n)))
|
||||
(prompt (car (last lines))))
|
||||
(pcase prompt
|
||||
|
|
Loading…
Add table
Reference in a new issue