Don't process SCINTILLA_TRICKS onCharHook when autocomplete is active.

(ESC being the exception that proves the rule.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15001
This commit is contained in:
Jeff Young 2023-06-28 00:04:50 +01:00
parent 0dc5ba346e
commit c2f2247ae3
1 changed files with 15 additions and 12 deletions

View File

@ -173,6 +173,21 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
{
wxString c = aEvent.GetUnicodeKey();
if( m_te->AutoCompActive() )
{
if( aEvent.GetKeyCode() == WXK_ESCAPE )
{
m_te->AutoCompCancel();
m_suppressAutocomplete = true; // Don't run autocomplete again on the next char...
}
else
{
aEvent.Skip();
}
return;
}
if( !isalpha( aEvent.GetKeyCode() ) )
m_suppressAutocomplete = false;
@ -274,18 +289,6 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
m_te->DeleteBack();
}
else if( aEvent.GetKeyCode() == WXK_ESCAPE )
{
if( m_te->AutoCompActive() )
{
m_te->AutoCompCancel();
m_suppressAutocomplete = true; // Don't run autocomplete again on the next char...
}
else
{
aEvent.Skip();
}
}
else if( isCtrlSlash( aEvent ) )
{
int startLine = m_te->LineFromPosition( m_te->GetSelectionStart() );