File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -92,3 +92,15 @@ const SYMBOL_FILTER_SHORTCUT: KeyboardShortcut = KeyboardShortcut::new(Modifiers
92
92
pub fn consume_symbol_filter_shortcut ( ctx : & Context ) -> bool {
93
93
ctx. input_mut ( |i| i. consume_shortcut ( & SYMBOL_FILTER_SHORTCUT ) )
94
94
}
95
+
96
+ const CHANGE_TARGET_SHORTCUT : KeyboardShortcut = KeyboardShortcut :: new ( Modifiers :: CTRL , Key :: T ) ;
97
+
98
+ pub fn consume_change_target_shortcut ( ctx : & Context ) -> bool {
99
+ ctx. input_mut ( |i| i. consume_shortcut ( & CHANGE_TARGET_SHORTCUT ) )
100
+ }
101
+
102
+ const CHANGE_BASE_SHORTCUT : KeyboardShortcut = KeyboardShortcut :: new ( Modifiers :: CTRL , Key :: B ) ;
103
+
104
+ pub fn consume_change_base_shortcut ( ctx : & Context ) -> bool {
105
+ ctx. input_mut ( |i| i. consume_shortcut ( & CHANGE_BASE_SHORTCUT ) )
106
+ }
Original file line number Diff line number Diff line change @@ -714,10 +714,11 @@ pub fn function_diff_ui(
714
714
. color ( appearance. highlight_color ) ,
715
715
) ;
716
716
if right_ctx. map_or ( false , |m| m. has_symbol ( ) )
717
- && ui
717
+ && ( ui
718
718
. button ( "Change target" )
719
719
. on_hover_text_at_pointer ( "Choose a different symbol to use as the target" )
720
720
. clicked ( )
721
+ || hotkeys:: consume_change_target_shortcut ( ui. ctx ( ) ) )
721
722
{
722
723
if let Some ( symbol_ref) = state. symbol_state . right_symbol . as_ref ( ) {
723
724
ret = Some ( DiffViewAction :: SelectingLeft ( symbol_ref. clone ( ) ) ) ;
@@ -791,6 +792,7 @@ pub fn function_diff_ui(
791
792
"Choose a different symbol to use as the base" ,
792
793
)
793
794
. clicked ( )
795
+ || hotkeys:: consume_change_base_shortcut ( ui. ctx ( ) )
794
796
{
795
797
if let Some ( symbol_ref) = state. symbol_state . left_symbol . as_ref ( ) {
796
798
ret = Some ( DiffViewAction :: SelectingRight ( symbol_ref. clone ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments