Skip to content

Commit c33c7d2

Browse files
authored
fixed code area unicode word selection (#1139)
1 parent d877177 commit c33c7d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

richtextfx/src/main/java/org/fxmisc/richtext/CodeArea.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,13 @@ public CodeArea(@NamedArg("text") String text) {
5454
selectRange(0, 0);
5555
}
5656

57-
protected Pattern WORD_PATTERN = Pattern.compile( "\\w+" );
57+
protected Pattern WORD_PATTERN = Pattern.compile( "\\w+", Pattern.UNICODE_CHARACTER_CLASS );
5858
protected Pattern WORD_OR_SYMBOL = Pattern.compile(
5959
"([\\W&&[^\\h]]{2}" // Any two non-word characters (excluding white spaces), matches like:
6060
// != <= >= == += -= *= -- ++ () [] <> && || // /* */
6161
+"|\\w*)" // Zero or more word characters [a-zA-Z_0-9]
6262
+"\\h*" // Both cases above include any trailing white space
63+
, Pattern.UNICODE_CHARACTER_CLASS
6364
);
6465

6566
/**

0 commit comments

Comments
 (0)