[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55 from bkruczyk/fix-regex-font-locking |
Date: |
Sun, 6 Feb 2022 16:59:19 -0500 (EST) |
branch: elpa/typescript-mode
commit 56a1ea861f80979d376716629abfce45a8e5e2c7
Merge: 30391a518a 393ac6db0f
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>
Merge pull request #55 from bkruczyk/fix-regex-font-locking
Simplify regexp literal
---
typescript-mode-tests.el | 23 +++++++++++++++++++++++
typescript-mode.el | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 6933d4fb6b..4a9e4f0f4c 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -277,6 +277,29 @@ declare function declareFunctionDefn(x3: xty3, y3: yty3):
ret3;"
(("y0" "y1" "y2" "y3") . font-lock-variable-name-face)
(("ret0" "ret1" "ret2" "ret3") . nil))))
+(ert-deftest font-lock/regexp ()
+ "Regular expresssions should be fontified as string constant."
+ (let ((content "=/foo/ (/bar/ ,/baz/ :/buzz/"))
+ (font-lock-test content
+ '(("=" . nil) ("/foo/" . font-lock-string-face)
+ ("(" . nil) ("/bar/" . font-lock-string-face)
+ ("," . nil) ("/baz/" . font-lock-string-face)
+ (":" . nil) ("/buzz/" . font-lock-string-face)))))
+
+(ert-deftest
font-lock/text-after-trailing-regexp-delim-should-not-be-fontified ()
+ "Text after trailing regular expression delimiter should not be fontified."
+ (test-with-temp-buffer
+ "=/foo/g something // comment"
+ (should (eq (get-face-at "g something") nil)))
+ (test-with-temp-buffer
+ "=/foo\\bar/g something // comment"
+ (should (eq (get-face-at "g something") nil)))
+ (test-with-temp-buffer
+ "=/foo\\\\bar/g something // comment"
+ (should (eq (get-face-at "g something") nil)))
+ (test-with-temp-buffer
+ "=/foo\\\\/g something // comment"
+ (should (eq (get-face-at "g something") nil))))
(defun flyspell-predicate-test (search-for)
"This function runs a test on
diff --git a/typescript-mode.el b/typescript-mode.el
index 9d16f697d7..25918105a0 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1871,7 +1871,7 @@ This performs fontification according to
`typescript--class-styles'."
;; as the newline is escaped with \. Account for that in the regexp
;; below.
(defconst typescript--regexp-literal
-
"[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\/\\|[^/*]\\)\\(?:\\\\/\\|[^/]\\)*\\(/\\)"
+ "[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)[^/]*\\(/\\)"
"Regexp matching a typescript regular expression literal.
Match groups 1 and 2 are the characters forming the beginning and
end of the literal.")
- [nongnu] elpa/typescript-mode 9db704ec1f 185/222: Fix duplicate test name, (continued)
- [nongnu] elpa/typescript-mode 9db704ec1f 185/222: Fix duplicate test name, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4832652496 163/222: Support electric-layout-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 710f5425a4 189/222: Add tests for typescript-indent-list-items option, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1fd835e7f8 205/222: Fix typos in README, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 30391a518a 079/222: Fix indentation issue with conditional operators., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2d382d8bfb 053/222: Support rule names and severity in tslint reports., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 83579fac6e 070/222: Remove the explicit invocation of the mode hook., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e700af4703 092/222: Use syntax-propertize-function to fontify regexps., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 46e032e932 054/222: Fix list of values compilation mode should use., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55 from bkruczyk/fix-regex-font-locking,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 0353bd72f8 133/222: Add bigint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 18dc5a36a6 140/222: Fixes typo in the README file., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 36105abbb1 141/222: Add 26.1 to the versions we test on., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 08ceb01ff3 142/222: We no longer support 24.3, fixes #100., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f33751e98f 145/222: Fix a case of bad indentation., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1ec94013e7 146/222: Run emacs --version prior to running cask., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 871c23111a 157/222: rename to typescript-mode and move to root, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f2761fb313 178/222: Extract type-name regexp into reusable constant., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b4109ac220 192/222: Merge pull request #139 from phst/should-not, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 12b6aae381 196/222: Merge pull request #141 from cireu/fix-auto-mode-list-re, ELPA Syncer, 2022/02/06