From 9975b8fb1041693bbc95d0515939bdd63328e16c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 8 Jul 2021 20:44:04 +0100 Subject: [PATCH] Attempt to handle deleting double-byte chars in Scintilla. --- common/scintilla_tricks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/scintilla_tricks.cpp b/common/scintilla_tricks.cpp index 13943e224e..fa772d9bde 100644 --- a/common/scintilla_tricks.cpp +++ b/common/scintilla_tricks.cpp @@ -208,10 +208,11 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent ) } else if( aEvent.GetKeyCode() == WXK_DELETE ) { + if( m_te->GetSelectionEnd() == m_te->GetSelectionStart() ) + m_te->CharRightExtend(); + if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() ) m_te->DeleteBack(); - else - m_te->DeleteRange( m_te->GetSelectionStart(), 1 ); } else if( aEvent.GetKeyCode() == WXK_ESCAPE ) {