branch: elpa/flycheck
commit ddca9f77297adbebf673f845b8d4a473b5d75df2
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Isolate bidi characters in error message snippets
Wrap error snippets in Unicode directional isolate characters
(U+2068 FIRST STRONG ISOLATE / U+2069 POP DIRECTIONAL ISOLATE)
to prevent bidirectional formatting characters in source code from
corrupting error message display.
Fixes #1919
---
flycheck.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/flycheck.el b/flycheck.el
index 135c2ad14a..997577cd18 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -3951,7 +3951,8 @@ beginning position)."
(concat (and other-file-p (format "In %S:\n" (file-relative-name fname)))
(and include-snippet
(when-let* ((snippet (flycheck-error-format-snippet err)))
- (format-message "`%s': " snippet)))
+ (format-message "`\N{FIRST STRONG ISOLATE}%s\N{POP
DIRECTIONAL ISOLATE}': "
+ snippet)))
(or (flycheck-error-message err)
(format "Unknown %S" (flycheck-error-level err)))
(and id (format " [%s]" id)))))