Skip to content

Commit

Permalink
Adjust variable names to follow convention;
Browse files Browse the repository at this point in the history
  • Loading branch information
alektron committed Aug 27, 2024
1 parent c37d47d commit ea012fe
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3966,21 +3966,21 @@ static int CountLeadingHighBits(unsigned char b)
static int IMSTB_TEXTEDIT_GETPREVIOUSCHARINDEX_IMPL(ImGuiInputTextState* obj, int idx)
{
//Backwards check/count for UTF-8 multi byte sequence
int numSeqBytes = 0;
int num_seq_bytes = 0;
for (int i = idx - 1; i >= 0; i -= 1)
{
bool isSeqByte = (obj->TextA.Data[i] & 0x80) == 0x80 && (obj->TextA.Data[i] & 0x40) == 0;
numSeqBytes += isSeqByte;
if (!isSeqByte)
bool is_seq_byte = (obj->TextA.Data[i] & 0x80) == 0x80 && (obj->TextA.Data[i] & 0x40) == 0;
num_seq_bytes += is_seq_byte;
if (!is_seq_byte)
{
if (numSeqBytes > 0)
if (num_seq_bytes > 0)
{
char initialByte = obj->TextA.Data[i];
char numLeadingBits = (char)CountLeadingHighBits(initialByte);
bool isMultiByteSeq = numLeadingBits == numSeqBytes + 1;
if (isMultiByteSeq)
char initial_byte = obj->TextA.Data[i];
char num_leading_bits = (char)CountLeadingHighBits(initial_byte);
bool is_multi_byte_seq = num_leading_bits == num_seq_bytes + 1;
if (is_multi_byte_seq)
{
return idx - (numSeqBytes + 1);
return idx - (num_seq_bytes + 1);
}
}
break;
Expand Down

0 comments on commit ea012fe

Please sign in to comment.