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:
parent
0dc5ba346e
commit
c2f2247ae3
|
@ -173,6 +173,21 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxString c = aEvent.GetUnicodeKey();
|
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() ) )
|
if( !isalpha( aEvent.GetKeyCode() ) )
|
||||||
m_suppressAutocomplete = false;
|
m_suppressAutocomplete = false;
|
||||||
|
|
||||||
|
@ -274,18 +289,6 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
|
||||||
if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
|
if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
|
||||||
m_te->DeleteBack();
|
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 ) )
|
else if( isCtrlSlash( aEvent ) )
|
||||||
{
|
{
|
||||||
int startLine = m_te->LineFromPosition( m_te->GetSelectionStart() );
|
int startLine = m_te->LineFromPosition( m_te->GetSelectionStart() );
|
||||||
|
|
Loading…
Reference in New Issue