|| (type == STRONG_L
&& (bidi_it->orig_type == STRONG_R
|| bidi_it->orig_type == STRONG_AL))
- /* Detect strong L or R types that were pushed into higher
- embedding levels (and will thus reorder) by explicit
- embeddings and isolates. */
- || (bidi_it->orig_type == STRONG_L
+ /* Detect strong L or R types or WEAK_EN types that were
+ pushed into higher embedding levels (and will thus
+ reorder) by explicit embeddings and isolates. */
+ || ((bidi_it->orig_type == STRONG_L
+ || bidi_it->orig_type == WEAK_EN)
&& bidi_it->level_stack[bidi_it->stack_idx].level > max_l2r)
|| ((bidi_it->orig_type == STRONG_R
|| bidi_it->orig_type == STRONG_AL)
(width-in-chars (/ (car size) char-width)))
(should (equal width-in-chars 3)))))
-(ert-deftest xdisp-tests--find-directional-overrides ()
+(ert-deftest xdisp-tests--find-directional-overrides-case-1 ()
(with-temp-buffer
(insert "\
int main() {
nil)
46))))
+(ert-deftest xdisp-tests--find-directional-overrides-case-2 ()
+ (with-temp-buffer
+ (insert "\
+#define is_restricted_user(user) \\
+ !strcmp (user, \"root\") ? 0 : \\
+ !strcmp (user, \"admin\") ? 0 : \\
+ !strcmp (user, \"superuser? 0 : 1 \")
+
+int main () {
+ printf (\"root: %d\\n\", is_restricted_user (\"root\"));
+ printf (\"admin: %d\\n\", is_restricted_user (\"admin\"));
+ printf (\"superuser: %d\\n\", is_restricted_user (\"superuser\"));
+ printf (\"luser: %d\\n\", is_restricted_user (\"luser\"));
+ printf (\"nobody: %d\\n\", is_restricted_user (\"nobody\"));
+}")
+ (goto-char (point-min))
+ (should (eq (bidi-find-overridden-directionality (point-min) (point-max)
+ nil)
+ 140))))
+
;;; xdisp-tests.el ends here