diff --git a/CHANGE_LOG.md b/CHANGE_LOG.md index 374f46c..4a0f23c 100644 --- a/CHANGE_LOG.md +++ b/CHANGE_LOG.md @@ -1,8 +1,15 @@ # Change Log -## 08/27/2021 - 0.9.21 - fixed a mouse behavior issue when in marked selection mode +## 09/01/2021 + 0.9.30 - case changing options now maintain selection, and single action case + changes no longer advance cursor. + - fixed ctrl-HOME and ctrl-END to navigate to top and bottom of document + - fixed Recent Files menu, now updates as soon as you save a new file + - added copy word and delete word to edit menu + - fixed a mouse behavior issue when in marked selection mode - any insert change should now deactivate marked selection mode as it should + +## 08/27/2021 0.9.20 feature changes: - added option for settings Default Extension= allows setting the default extension that SavageEd appends to diff --git a/src/SavageEd.hhf b/src/SavageEd.hhf index 1a11813..c61d85c 100644 --- a/src/SavageEd.hhf +++ b/src/SavageEd.hhf @@ -7,7 +7,7 @@ readonly - version :string := "SavageEd v0.9.21"; + version :string := "SavageEd v0.9.30"; type // Message and dispatch table related definitions: @@ -149,7 +149,10 @@ type IDM_TO_UPPER, IDM_TO_LOWER, IDM_INCREASE_INDENT, - IDM_DECREASE_INDENT + IDM_DECREASE_INDENT, + IDM_COPY_WORD, + IDM_DELETE_WORD, + IDM_KILL_LINE }; rect_t: diff --git a/src/SavageEd.hla b/src/SavageEd.hla index b924f2d..a2ebe54 100644 --- a/src/SavageEd.hla +++ b/src/SavageEd.hla @@ -794,16 +794,28 @@ proc mov( true, proc_return ); case( w.VK_END ) - if( shift_down ) then - command_select_to_eol(); - else - command_move_to_eol(); + if( ! ctrl_down ) then + if( shift_down ) then + command_select_to_eol(); + else + command_move_to_eol(); + endif; + jmp skip_proc; endif; + or( 1, eax ); + clear_keystate(); + w.CallWindowProc(info.old_proc, info.hred, w.WM_KEYDOWN, w.VK_END, 0 ); jmp skip_proc; case( w.VK_HOME ) - command_move_to_bol(); + if( !ctrl_down ) then + command_move_to_bol(); + jmp skip_proc; + endif; + or( 1, eax ); + clear_keystate(); + w.CallWindowProc(info.old_proc, info.hred, w.WM_KEYDOWN, w.VK_HOME, 0 ); jmp skip_proc; case( w.VK_SPACE ) @@ -1503,11 +1515,17 @@ proc end command_selection_to_string; - command_lowercase_selection :procedure {@noframe}; + command_lowercase_selection :procedure; + var + start_index :dword; + end_index :dword; begin command_lowercase_selection; pushad(); getInfo( info ); mov( info.cursor.start_index, eax ); + mov( eax, start_index ); + mov( info.cursor.end_index, end_index ); + if( eax = info.cursor.end_index ) then inc( info.cursor.end_index ); w.SendMessage( info.hred, w.EM_SETSEL, info.cursor.start_index, info.cursor.end_index ); @@ -1517,15 +1535,20 @@ proc str.lower1( esi ); w.SendMessage( info.hred, w.EM_REPLACESEL, true, esi ); str.free( esi ); + w.SendMessage( info.hred, w.EM_SETSEL, start_index, end_index ); popad(); - ret(); end command_lowercase_selection; - command_uppercase_selection :procedure {@noframe}; + command_uppercase_selection :procedure; + var + start_index :dword; + end_index :dword; begin command_uppercase_selection; pushad(); getInfo( info ); mov( info.cursor.start_index, eax ); + mov( eax, start_index ); + mov( info.cursor.end_index, end_index ); if( eax = info.cursor.end_index ) then inc( info.cursor.end_index ); w.SendMessage( info.hred, w.EM_SETSEL, info.cursor.start_index, info.cursor.end_index ); @@ -1535,8 +1558,8 @@ proc str.upper1( esi ); w.SendMessage( info.hred, w.EM_REPLACESEL, true, esi ); str.free( esi ); + w.SendMessage( info.hred, w.EM_SETSEL, start_index, end_index ); popad(); - ret(); end command_uppercase_selection; command_edit_ini :procedure; @@ -2076,10 +2099,18 @@ proc w.SendMessage(info.hred, w.WM_PASTE,0,0); w.SendMessage(info.hred, w.EM_SETMODIFY, true,0); - case( IDM_SELECTALL ) - + case( IDM_SELECTALL ) command_select_all(); + case( IDM_COPY_WORD ) + command_copy_word(); + + case( IDM_DELETE_WORD ) + command_delete_word(); + + case( IDM_KILL_LINE ) + command_cut_line(); + case( IDM_UNDO ) w.SendMessage(info.hred, w.EM_UNDO,0,0); diff --git a/src/Window.hla b/src/Window.hla index b2dd8e5..8619dd2 100644 --- a/src/Window.hla +++ b/src/Window.hla @@ -880,6 +880,9 @@ proc w.AppendMenu( edit_menu, w.MF_STRING, IDM_COPY, "C&opy Ctrl+C"); w.AppendMenu( edit_menu, w.MF_STRING, IDM_PASTE, "&Paste Ctrl+V"); w.AppendMenu( edit_menu, w.MF_STRING, IDM_SELECTALL, "Select &All Ctrl+A"); + w.AppendMenu( edit_menu, w.MF_STRING, IDM_COPY_WORD, "Copy Word Shift+Ctrl+W"); + w.AppendMenu( edit_menu, w.MF_STRING, IDM_DELETE_WORD, "Delete Word Ctrl+W"); + w.AppendMenu( edit_menu, w.MF_STRING, IDM_KILL_LINE, "Kill Line Ctrl+\"); w.AppendMenu( edit_menu, w.MF_SEPARATOR, NULL, NULL); w.AppendMenu( edit_menu, w.MF_STRING, IDM_TO_UPPER, "To Upper Case Ctrl+U"); w.AppendMenu( edit_menu, w.MF_STRING, IDM_TO_LOWER, "To Lower Case Shift+Ctrl+U"); @@ -1372,6 +1375,7 @@ proc config.deleteItem( s_recent, 20 ); endif; + updateMenu(); ret(); end updateRecentLog;