branch: master commit 2ee41c15f6f319f8463520278733f77b44619619 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
Add comments and strings to condition-case test. --- context-coloring.el | 16 ++++++++++++---- test/context-coloring-test.el | 4 +++- test/fixtures/condition-case.el | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/context-coloring.el b/context-coloring.el index de22014..afc05e4 100644 --- a/context-coloring.el +++ b/context-coloring.el @@ -288,6 +288,14 @@ them along the way." (context-coloring-elisp-colorize-comments-and-strings-in-region start (point)))) +(defsubst context-coloring-elisp-forward-sexp () + "Like `forward-sexp', but colorize comments and strings along +the way." + (let ((start (point))) + (forward-sexp) + (context-coloring-elisp-colorize-comments-and-strings-in-region + start (point)))) + (defsubst context-coloring-get-syntax-code () (syntax-class ;; Faster version of `syntax-after': @@ -412,7 +420,7 @@ provide visually \"instant\" updates at 60 frames per second.") (defsubst context-coloring-elisp-parse-arg (callback) (let* ((arg-string (buffer-substring-no-properties (point) - (progn (forward-sexp) + (progn (context-coloring-elisp-forward-sexp) (point))))) (when (not (string-match-p context-coloring-ignored-word-regexp @@ -614,7 +622,7 @@ provide visually \"instant\" updates at 60 frames per second.") (cond ((= syntax-code context-coloring-OPEN-PARENTHESIS-CODE) (setq case-pos (point)) - (forward-sexp) + (context-coloring-elisp-forward-sexp) (setq case-end (point)) (goto-char case-pos) ;; Enter. @@ -623,7 +631,7 @@ provide visually \"instant\" updates at 60 frames per second.") (setq syntax-code (context-coloring-get-syntax-code)) (when (/= syntax-code context-coloring-CLOSE-PARENTHESIS-CODE) ;; Skip the condition name(s). - (forward-sexp) + (context-coloring-elisp-forward-sexp) ;; Color the remaining portion of the handler. (context-coloring-elisp-colorize-region (point) @@ -632,7 +640,7 @@ provide visually \"instant\" updates at 60 frames per second.") (forward-char)) (t ;; Ignore artifacts. - (forward-sexp))) + (context-coloring-elisp-forward-sexp))) (context-coloring-elisp-forward-sws)) ;; Exit. (forward-char) diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el index 2cfd64a..e6e6a59 100644 --- a/test/context-coloring-test.el +++ b/test/context-coloring-test.el @@ -1173,8 +1173,10 @@ ssssssssssss0")) 1111111 111111 111 000011 (111111111-1111-111111-11111 111 + cc c (xxx () 222) - (11111 (xxx () 222)))"))) + (11111 (xxx () 222)) + sss)"))) (defun context-coloring-test-insert-unread-space () "Simulate the insertion of a space as if by a user." diff --git a/test/fixtures/condition-case.el b/test/fixtures/condition-case.el index bdbca7e..151f591 100644 --- a/test/fixtures/condition-case.el +++ b/test/fixtures/condition-case.el @@ -4,5 +4,7 @@ ((debug error) err free)) (condition-case-unless-debug nil + ;; c (let () nil) - (error (let () nil))) + (error (let () nil)) + "s")