Skip to content

Commit 78dfcb5

Browse files
committed
TextEditor::CodePoint::isWord: underscore is accepted as part of a word
For identifiers in most programming languages, _ is part of a word.
1 parent b37142d commit 78dfcb5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

TextEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6245,7 +6245,7 @@ bool TextEditor::CodePoint::isWhiteSpace(ImWchar codepoint) {
62456245

62466246
bool TextEditor::CodePoint::isWord(ImWchar codepoint) {
62476247
if (codepoint < 0x7f) {
6248-
return (static_cast<unsigned>((codepoint | 32) - 'a') < 26) || (static_cast<unsigned>(codepoint - '0') < 10);
6248+
return (static_cast<unsigned>((codepoint | 32) - 'a') < 26) || (static_cast<unsigned>(codepoint - '0') < 10) || codepoint == '_';
62496249

62506250
#if defined(IMGUI_USE_WCHAR32)
62516251
} else if (codepoint >= 0x10000) {

0 commit comments

Comments
 (0)