Skip to content

Commit

Permalink
Fix: BASIC insert/replace mode now properly inserts/replaces (only si…
Browse files Browse the repository at this point in the history
…ngle keys though!)
  • Loading branch information
GeorgRottensteiner committed May 27, 2019
1 parent 9d7452d commit 91a66aa
Show file tree
Hide file tree
Showing 4 changed files with 271 additions and 260 deletions.
22 changes: 17 additions & 5 deletions C64Studio/Documents/SourceBasicEx.cs
Expand Up @@ -1132,7 +1132,7 @@ protected override bool ProcessCmdKey( ref System.Windows.Forms.Message msg, Sys
}
}

editSource.SelectedText = "" + char.ToUpper( (char)keyData );
InsertOrReplaceChar( char.ToUpper( (char)keyData ) );
return true;
}
}
Expand All @@ -1144,13 +1144,13 @@ protected override bool ProcessCmdKey( ref System.Windows.Forms.Message msg, Sys
// hard coded mapping from ^ to arrow up (power)
if ( mappedKey == "^" )
{
editSource.SelectedText = "" + Types.ConstantData.PhysicalKeyInfo[KeyboardKey.KEY_ARROW_UP].Normal.CharValue;
InsertOrReplaceChar( Types.ConstantData.PhysicalKeyInfo[KeyboardKey.KEY_ARROW_UP].Normal.CharValue );
return true;
}
// PI
if ( mappedKey == "~" )
{
editSource.SelectedText = "" + Types.ConstantData.PhysicalKeyInfo[KeyboardKey.KEY_ARROW_UP].WithShift.CharValue;
InsertOrReplaceChar( Types.ConstantData.PhysicalKeyInfo[KeyboardKey.KEY_ARROW_UP].WithShift.CharValue );
return true;
}
/*
Expand Down Expand Up @@ -1265,11 +1265,11 @@ protected override bool ProcessCmdKey( ref System.Windows.Forms.Message msg, Sys
//Debug.Log( "Trying to map unknown token: " + key.ToString() );
if ( m_LowerCaseMode )
{
editSource.SelectedText = "" + c64Key.LowerCaseChar;
InsertOrReplaceChar( c64Key.LowerCaseChar );
}
else
{
editSource.SelectedText = "" + c64Key.CharValue;
InsertOrReplaceChar( c64Key.CharValue );
}
}
else
Expand All @@ -1290,6 +1290,18 @@ protected override bool ProcessCmdKey( ref System.Windows.Forms.Message msg, Sys



private void InsertOrReplaceChar( char Key )
{
if ( editSource.IsReplaceMode )
{
editSource.Selection.GoRight( true );
editSource.Selection.Inverse();
}
editSource.SelectedText = "" + Key;
}



private bool IsNotValidKey( string MappedKey )
{
if ( string.IsNullOrEmpty( MappedKey ) )
Expand Down
1 change: 0 additions & 1 deletion C64Studio/TODO.txt
@@ -1,6 +1,5 @@
C64Studio
o Output bei Custom Build kann Info von anderer Datei anzeigen?
o BASIC: Schalte ich Labelmode um und wieder zurück werden auch alle Spaces entfernt (sogar in REM Kommentaren?!).
o BASIC: Undo bei Label-Mode-Wechsel sollte Label-Mode mit wechseln!

o Die Sortierreihenfolge vom "autocomplete" führt bei mir häufig zu Eingabefehlern, weil die Vorschläge alphabetisch sortiert und nicht nach Relevanz dargestellt werden (siehe Bild).
Expand Down

0 comments on commit 91a66aa

Please sign in to comment.