Change DELETE behaviour from delete sel to delete forward.
In other words, if there's no selection delete the character in front of the cursor. Fixes https://gitlab.com/kicad/code/kicad/issues/4609
This commit is contained in:
parent
4357c1d3b3
commit
22b8133108
|
@ -129,6 +129,11 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent )
|
|||
{
|
||||
if( m_te->GetSelectionEnd() > m_te->GetSelectionStart() )
|
||||
m_te->DeleteBack();
|
||||
else
|
||||
{
|
||||
m_te->CharRight();
|
||||
m_te->DeleteBack();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ void TEXTENTRY_TRICKS::OnCharHook( wxTextEntry* aTextEntry, wxKeyEvent& aEvent )
|
|||
long start, end;
|
||||
aTextEntry->GetSelection( &start, &end );
|
||||
|
||||
if( start > end )
|
||||
if( end > start )
|
||||
{
|
||||
aTextEntry->Remove( start, end );
|
||||
aTextEntry->SetInsertionPoint( start );
|
||||
|
@ -80,6 +80,10 @@ void TEXTENTRY_TRICKS::OnCharHook( wxTextEntry* aTextEntry, wxKeyEvent& aEvent )
|
|||
aTextEntry->Remove( start, end );
|
||||
aTextEntry->SetInsertionPoint( start );
|
||||
}
|
||||
else if( start == end && start < aTextEntry->GetLastPosition() )
|
||||
{
|
||||
aTextEntry->Remove( start, start+1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue