summaryrefslogtreecommitdiff
path: root/servers/text_server.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-13 19:09:11 +0200
committerGitHub <noreply@github.com>2021-07-13 19:09:11 +0200
commit4e4bcbc98678ae6dc4e6878dd8c9ac2127671d55 (patch)
tree56cdc6c0e9925304863d5bd7868a24cc877a1108 /servers/text_server.cpp
parent79137a02608d65fd5f664a5210919c2e71ea6c5f (diff)
parent8b91828e4ff73fb3783b5fefcf9d150ce242907f (diff)
Merge pull request #47604 from christinoleo/master
Separate underscore from grapheme punctuation to enable doubleclick and caret jump over snakecase variables in editor
Diffstat (limited to 'servers/text_server.cpp')
-rw-r--r--servers/text_server.cpp4
1 files changed, 2 insertions, 2 deletions
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<Vector2i> TextServer::shaped_text_get_line_breaks(RID p_shaped, float p_w
return lines;
}
-Vector<Vector2i> TextServer::shaped_text_get_word_breaks(RID p_shaped) const {
+Vector<Vector2i> TextServer::shaped_text_get_word_breaks(RID p_shaped, int p_grapheme_flags) const {
Vector<Vector2i> words;
const_cast<TextServer *>(this)->shaped_text_update_justification_ops(p_shaped);
@@ -726,7 +726,7 @@ Vector<Vector2i> 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;
}