layout selection: Fix emoji and number
This commit is contained in:
		@ -80,7 +80,7 @@ const KEYBOARDS: &[(*const str, *const str)] = &[
 | 
				
			|||||||
    ("us+dvorak_wide", include_str!("../data/keyboards/us+dvorak_wide.yaml")),
 | 
					    ("us+dvorak_wide", include_str!("../data/keyboards/us+dvorak_wide.yaml")),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Others
 | 
					    // Others
 | 
				
			||||||
    ("number", include_str!("../data/keyboards/number.yaml")),
 | 
					    ("number/us", include_str!("../data/keyboards/number/us.yaml")),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Terminal
 | 
					    // Terminal
 | 
				
			||||||
    ("terminal/fr", include_str!("../data/keyboards/terminal/fr.yaml")),
 | 
					    ("terminal/fr", include_str!("../data/keyboards/terminal/fr.yaml")),
 | 
				
			||||||
@ -89,7 +89,7 @@ const KEYBOARDS: &[(*const str, *const str)] = &[
 | 
				
			|||||||
    ("terminal/us_wide",   include_str!("../data/keyboards/terminal/us_wide.yaml")),
 | 
					    ("terminal/us_wide",   include_str!("../data/keyboards/terminal/us_wide.yaml")),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Overlays
 | 
					    // Overlays
 | 
				
			||||||
    ("emoji", include_str!("../data/keyboards/emoji.yaml")),
 | 
					    ("emoji/us", include_str!("../data/keyboards/emoji/us.yaml")),
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub fn get_keyboard(needle: &str) -> Option<&'static str> {
 | 
					pub fn get_keyboard(needle: &str) -> Option<&'static str> {
 | 
				
			||||||
@ -108,6 +108,7 @@ pub fn get_keyboard(needle: &str) -> Option<&'static str> {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const OVERLAY_NAMES: &[*const str] = &[
 | 
					const OVERLAY_NAMES: &[*const str] = &[
 | 
				
			||||||
    "emoji",
 | 
					    "emoji",
 | 
				
			||||||
 | 
					    "terminal",
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pub fn get_overlays() -> Vec<&'static str> {
 | 
					pub fn get_overlays() -> Vec<&'static str> {
 | 
				
			||||||
@ -171,7 +172,7 @@ mod test {
 | 
				
			|||||||
    #[test]
 | 
					    #[test]
 | 
				
			||||||
    fn check_overlays_present() {
 | 
					    fn check_overlays_present() {
 | 
				
			||||||
        for name in get_overlays() {
 | 
					        for name in get_overlays() {
 | 
				
			||||||
            assert!(get_keyboard(name).is_some());
 | 
					            assert!(get_keyboard(&format!("{}/us", name)).is_some());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -91,11 +91,11 @@ foreach layout : [
 | 
				
			|||||||
    'terminal/us_wide',
 | 
					    'terminal/us_wide',
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    # Block: Not languages.
 | 
					    # Block: Not languages.
 | 
				
			||||||
    'emoji',
 | 
					    'emoji/us',
 | 
				
			||||||
    'number',
 | 
					    'number/us',
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
    extra = []
 | 
					    extra = []
 | 
				
			||||||
    if layout == 'emoji'
 | 
					    if layout.startswith('emoji/')
 | 
				
			||||||
        extra += ['allow_missing_return']
 | 
					        extra += ['allow_missing_return']
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user