mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	commands: fail when criteria match nothing
For whatever command, this probably was not intended by the user
This commit is contained in:
		
							parent
							
								
									514eed7e4b
								
							
						
					
					
						commit
						b2d4caf6c3
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -458,7 +458,11 @@ struct cmd_results *handle_command(char *_exec, enum command_context context) {
 | 
				
			||||||
				if (!containers) {
 | 
									if (!containers) {
 | 
				
			||||||
					current_container = get_focused_container(&root_container);
 | 
										current_container = get_focused_container(&root_container);
 | 
				
			||||||
				} else if (containers->length == 0) {
 | 
									} else if (containers->length == 0) {
 | 
				
			||||||
					break;
 | 
										if (results) {
 | 
				
			||||||
 | 
											free_cmd_results(results);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										results = cmd_results_new(CMD_FAILURE, argv[0], "No matching container");
 | 
				
			||||||
 | 
										goto cleanup;
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					current_container = (swayc_t *)containers->items[i];
 | 
										current_container = (swayc_t *)containers->items[i];
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue