1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merge remote-tracking branch 'origin/master' into feature/android

This commit is contained in:
Po Lu 2023-06-16 08:40:33 +08:00
commit 7f0342a1bd
4 changed files with 35 additions and 7 deletions

View file

@ -180,7 +180,8 @@ negative, find the Nth next match."
(text-property-search-forward 'field 'prompt t))
(setq n (1- n)))
(let (match this-match)
(forward-line 0) ; Don't count prompt on current line.
;; Don't count the current prompt.
(text-property-search-backward 'field 'prompt t)
(while (and (< n 0)
(setq this-match (text-property-search-backward
'field 'prompt t)))

View file

@ -3394,7 +3394,9 @@ position of the end of the unsafe construct."
(goto-char (nth 8 state)) ; beginning of this here-doc
(cperl-backward-to-noncomment ; skip back over more
(point-min)) ; here-documents (if any)
(beginning-of-line)))) ; skip back over here-doc starters
(beginning-of-line)) ; skip back over here-doc starters
((nth 4 state) ; in a comment (or POD)
(goto-char (nth 8 state))))) ; ...so go to its beginning
(while (and pos (progn
(beginning-of-line)
(get-text-property (setq pos (point)) 'syntax-type)))

View file

@ -3070,7 +3070,9 @@ nil, the grammar is installed to the standard location, the
nil
'treesit--install-language-grammar-out-dir-history
default-out-dir)
out-dir)))
;; When called non-interactively, OUT-DIR should
;; default to DEFAULT-OUT-DIR.
(or out-dir default-out-dir))))
(condition-case err
(progn
(apply #'treesit--install-language-grammar-1

View file

@ -80,8 +80,13 @@ This tests the case when `eshell-highlight-prompt' is nil."
(apply #'propertize "hello\n"
eshell-command-output-properties)))))))
(ert-deftest em-prompt-test/next-previous-prompt ()
"Check that navigating forward/backward through old prompts works correctly."
(defmacro em-prompt-test--with-multiline (&rest body)
"Execute BODY with a multiline Eshell prompt."
`(let ((eshell-prompt-function (lambda () "multiline prompt\n$ ")))
,@body))
(defun em-prompt-test/next-previous-prompt-with ()
"Helper for checking forward/backward navigation of old prompts."
(with-temp-eshell
(eshell-insert-command "echo one")
(eshell-insert-command "echo two")
@ -98,8 +103,17 @@ This tests the case when `eshell-highlight-prompt' is nil."
(eshell-next-prompt 3)
(should (equal (eshell-get-old-input) "echo fou"))))
(ert-deftest em-prompt-test/forward-backward-matching-input ()
"Check that navigating forward/backward via regexps works correctly."
(ert-deftest em-prompt-test/next-previous-prompt ()
"Check that navigating forward/backward through old prompts works correctly."
(em-prompt-test/next-previous-prompt-with))
(ert-deftest em-prompt-test/next-previous-prompt-multiline ()
"Check old prompt forward/backward navigation for multiline prompts."
(em-prompt-test--with-multiline
(em-prompt-test/next-previous-prompt-with)))
(defun em-prompt-test/forward-backward-matching-input-with ()
"Helper for checking forward/backward navigation via regexps."
(with-temp-eshell
(eshell-insert-command "echo one")
(eshell-insert-command "printnl something else")
@ -117,4 +131,13 @@ This tests the case when `eshell-highlight-prompt' is nil."
(eshell-forward-matching-input "echo" 3)
(should (equal (eshell-get-old-input) "echo fou"))))
(ert-deftest em-prompt-test/forward-backward-matching-input ()
"Check that navigating forward/backward via regexps works correctly."
(em-prompt-test/forward-backward-matching-input-with))
(ert-deftest em-prompt-test/forward-backward-matching-input-multiline ()
"Check forward/backward regexp navigation for multiline prompts."
(em-prompt-test--with-multiline
(em-prompt-test/forward-backward-matching-input-with)))
;;; em-prompt-tests.el ends here