Tk Source Code

Artifact [2032a2ef]
Login

Artifact 2032a2ef4ce3fd253d92cb45863507bf9857f8c1b3a0e32b390f7db43ed54f23:

Attachment "orphan-nikkud-chunkbidi.patch" to ticket [59d6d5f6] added by anonymous 2026-10-31 04:49:43. (unpublished)
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -1403,6 +1403,22 @@
 	if (chLen <= 0) {
 	    break;
 	}
+	/*
+	 * Combining marks are not strong characters: UAX #9 rule P2 skips
+	 * nonspacing marks when searching for the first strong character,
+	 * and rule W1 resolves a mark to the class of the preceding
+	 * character (to the embedding level at the start of the text).
+	 * This is the same skip as in ChunkIsRtl: without it, a base-less
+	 * vowel point such as an orphan Hebrew nikkud (U+05B0..U+05BD, all
+	 * inside the 0x0590..0x08FF range below) makes this function return
+	 * RTL, so BidiReorderChunks mirrors the whole display line even
+	 * though the first strong character is L. [8504cdc7c8]
+	 */
+
+	if (mjb_codepoint_is_combining(ch)) {
+	    p += chLen;
+	    continue;
+	}
 	/* Hebrew, Arabic, Syriac, NKo, Thaana, Samaritan and supplements */
 	if (ch >= 0x0590 && ch <= 0x08FF) {
 	    return 2;