CEdit::DeleteOne expands selection to delete integer number of UTF-8 symbols
parent
cd059bd511
commit
65da4c42c4
|
@ -2787,6 +2787,11 @@ void CEdit::DeleteOne(int dir)
|
|||
}
|
||||
|
||||
if ( m_cursor1 > m_cursor2 ) Math::Swap(m_cursor1, m_cursor2);
|
||||
|
||||
// Expands selection to delete integer number of UTF-8 symbols
|
||||
while ( m_cursor1 > 0 && (m_text[m_cursor1] & 0xC0) == 0x80 ) m_cursor1 --;
|
||||
while ( m_cursor2 < m_len && (m_text[m_cursor2] & 0xC0) == 0x80 ) m_cursor2 ++;
|
||||
|
||||
hole = m_cursor2-m_cursor1;
|
||||
end = m_len-hole;
|
||||
for ( i=m_cursor1 ; i<end ; i++ )
|
||||
|
|
Loading…
Reference in New Issue