From 8b91828e4ff73fb3783b5fefcf9d150ce242907f Mon Sep 17 00:00:00 2001 From: Leonardo Christino Date: Sat, 3 Apr 2021 12:17:51 -0300 Subject: Separate underscore from grapheme punctuation to enable doubleclick and caret jump over snakecase variables in editor --- servers/text_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'servers/text_server.cpp') diff --git a/servers/text_server.cpp b/servers/text_server.cpp index 97cfe828f0..1491368109 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -712,7 +712,7 @@ Vector TextServer::shaped_text_get_line_breaks(RID p_shaped, float p_w return lines; } -Vector TextServer::shaped_text_get_word_breaks(RID p_shaped) const { +Vector TextServer::shaped_text_get_word_breaks(RID p_shaped, int p_grapheme_flags) const { Vector words; const_cast(this)->shaped_text_update_justification_ops(p_shaped); @@ -726,7 +726,7 @@ Vector TextServer::shaped_text_get_word_breaks(RID p_shaped) const { for (int i = 0; i < l_size; i++) { if (l_gl[i].count > 0) { - if (((l_gl[i].flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE) || ((l_gl[i].flags & GRAPHEME_IS_PUNCTUATION) == GRAPHEME_IS_PUNCTUATION)) { + if ((l_gl[i].flags & p_grapheme_flags) != 0) { words.push_back(Vector2i(word_start, l_gl[i].start)); word_start = l_gl[i].end; } -- cgit v1.2.3