mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	hotkey: Move ctrl+[ back from cmd+[.
This was incorrectly changed; the goal here is to match what vim does for this keyboard shortcut. Fixes #9525.
This commit is contained in:
		@@ -47,9 +47,12 @@ var keydown_unshift_mappings = {
 | 
			
		||||
    40: {name: 'down_arrow', message_view_only: false}, // down arrow
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var keydown_ctrl_mappings = {
 | 
			
		||||
    219: {name: 'escape', message_view_only: false}, // '['
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var keydown_cmd_or_ctrl_mappings = {
 | 
			
		||||
    75: {name: 'search_with_k', message_view_only: false}, // 'K'
 | 
			
		||||
    219: {name: 'escape', message_view_only: false}, // '['
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var keydown_either_mappings = {
 | 
			
		||||
@@ -113,6 +116,13 @@ exports.get_keydown_hotkey = function (e) {
 | 
			
		||||
 | 
			
		||||
    var hotkey;
 | 
			
		||||
 | 
			
		||||
    if (e.ctrlKey) {
 | 
			
		||||
        hotkey = keydown_ctrl_mappings[e.which];
 | 
			
		||||
        if (hotkey) {
 | 
			
		||||
            return hotkey;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    var isCmdOrCtrl = /Mac/i.test(navigator.userAgent) ? e.metaKey : e.ctrlKey;
 | 
			
		||||
    if (isCmdOrCtrl) {
 | 
			
		||||
        hotkey = keydown_cmd_or_ctrl_mappings[e.which];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user