Separate underscore from grapheme punctuation to enable doubleclick and caret jump over snakecase variables in editor
This commit is contained in:
parent
9e0e74e58e
commit
8b91828e4f
7 changed files with 26 additions and 12 deletions
|
|
@ -129,6 +129,10 @@ _FORCE_INLINE_ bool is_linebreak(char32_t p_char) {
|
|||
return (p_char >= 0x000a && p_char <= 0x000d) || (p_char == 0x0085) || (p_char == 0x2028) || (p_char == 0x2029);
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool is_underscore(char32_t p_char) {
|
||||
return (p_char == 0x005F);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
String TextServerAdvanced::interface_name = "ICU / HarfBuzz / Graphite";
|
||||
|
|
@ -1883,7 +1887,10 @@ bool TextServerAdvanced::shaped_text_update_breaks(RID p_shaped) {
|
|||
if (is_whitespace(c)) {
|
||||
sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;
|
||||
}
|
||||
if (u_ispunct(c)) {
|
||||
if (is_underscore(c)) {
|
||||
sd_glyphs[i].flags |= GRAPHEME_IS_UNDERSCORE;
|
||||
}
|
||||
if (u_ispunct(c) && c != 0x005F) {
|
||||
sd_glyphs[i].flags |= GRAPHEME_IS_PUNCTUATION;
|
||||
}
|
||||
if (breaks.has(sd->glyphs[i].start)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue